The Daily Click ::. Forums ::. Klik Coding Help ::. Mouse Aiming in MMF
 

Post Reply  Post Oekaki 
 

Posted By Message

Corsair



Registered
  26/06/2004
Points
  16
29th January, 2005 at 21:37:16 -

Hey just wondering if anyone could help me figure out how to get an object to always look in teh direction of the mouse. The inteneded application is a top down shooter much like crimsonland (legs controlled by keyboard and upper torso controlled by mouse)

I'm fiddling around with MMF and having some trouble figuring this one out. I could always make teh upper torso controlled by a seperate set of keys, but that isn't exactly what I'd like. Anyways help would be much appreciated.

Thanks

 
Don't knock on death's door- ring the doorbell and run away. He hates that.

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
29th January, 2005 at 21:58:00 -

Create an object, draw a crosshair or something, and centre the hotspot.
Add the event:
+ Always
: Crosshair: Set X to XMouse
: Crosshair: Set Y to YMouse
: Player: Look at 0,0 from Crosshair

 
- Tigerworks

Corsair



Registered
  26/06/2004
Points
  16
29th January, 2005 at 21:58:52 -

And suddenly I feel more than a little stupid. Thanks appreciate the help alot

Image Edited by the Author.

 
Don't knock on death's door- ring the doorbell and run away. He hates that.

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
14th February, 2005 at 16:24:31 -

Hahah, oh well. I've done this before, it was good fun. I had Fox from Starfox doing a platform movement, with his arm and gun as a separate object which always faced the crosshair, and he always watched it too, and if he was running away from it he'd face it and play a backwards walking animation, it was pretty cool. I haven't made a game out of it yet though.

 
http://www.fzgames.com
   

Post Reply



 



Advertisement

Worth A Click