View Single Post
How to move an object toward cursor?
Old
daveelton
Guest
 
Status:
Posts: n/a
Default How to move an object toward cursor? - 10-01-2006, 04:27 PM

Hello all,

I am looking for a way to have an object move toward where the mouse was clicked (a person is throwing an object into the distance, and gravity can be ignored for simplicity... a straight line throw toward the cursor is good enough). I thought about creating an invisible "target" and moving it to the location that the mouse is clicked at and then have the object move toward the target, but it turns out that even moving this target to the location of the mouse when it is clicked is more difficult than I had imagined... the only mouse related functions I can find are world.mouse distance from left edge and world.mouse distance from top edge... which I can think of a way to use these values if there is a way to find out the height of the world (the width shouldn't be as important since measurement from the left should start at 0), but I have not had any luck with finding that value either. Any ideas? Thanks in advance.
   
Reply With Quote