The Daily Click ::. Forums ::. Klik Coding Help ::. how do you make an active object follow the mouse?
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
16th November, 2010 at 22:05:21 -

i want to make it so my main characters arms and gun follow where the mouse points, so you can point, click and shoot. i keep trying
[always]
set direction of active to x position of mouse + y position of mouse

but it just flails aimlessly, ive never done anything like this before so any help would be greatly appreciated. thanks!

 
[Game design makes my brain feel like its gonna explode.]

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
16th November, 2010 at 22:28:02 -

So you mean you want the character to always be looking at the mouse? If so this could be done in two ways using a formula that changes the angle of the mouse and make the character rotate much smoother, or use the "look in direction of.." action under direction.

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
16th November, 2010 at 22:32:56 -

http://www.mediafire.com/?25omm3002vi4v25

Four Words Long Yeah

enjoy (btw pay attention to where the hotspot is.)

Edited by GamesterXIII

 
n/a

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
16th November, 2010 at 22:34:55 -

http://www.create-games.com/article.asp?id=1898

I think the Angle Between two points might be what you're looking for.

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
16th November, 2010 at 22:36:53 -


Originally Posted by HorrendousGames
http://www.create-games.com/article.asp?id=1898

I think the Angle Between two points might be what you're looking for.



already done in post above.

 
n/a

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
16th November, 2010 at 22:39:50 -


Originally Posted by GamesterXIII

Originally Posted by HorrendousGames
http://www.create-games.com/article.asp?id=1898

I think the Angle Between two points might be what you're looking for.



already done in post above.



Yeah, you replied while I was still replying, I didn't realize helping someone was a competition, chill. Besides, that article has more useful information he can learn from than just handing the one thing to him.

EDIT: What happens if he's not using MMF2 Build 248+? I'm not speaking from expirience, but does TGF2 or any of the other ones have the ATan2 function?

EDIT Part 2 - The Editing:

Originally Posted by Jon C-B
or use the "look in direction of.." action under direction.



In order to do this correctly, he'll need a separate active, one thats position has it's X and Y set to XMouse and YMouse respectively, then have the rotating active look in the direction of the active stuck on the mouse.

Edited by HorrendousGames

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
17th November, 2010 at 05:24:27 -

Thanks everyone, i figured it out. i just have a active object that is always located at the x and y coordinates of the mouse and then i set the gun to always look in the direction of that object.

 
[Game design makes my brain feel like its gonna explode.]
   

Post Reply



 



Advertisement

Worth A Click