Game Development Community

Getting Objects to shoot towards mouse

by Michael Vanderpool · in Torque Game Builder · 02/24/2009 (7:14 am) · 2 replies

Yes yes, I know what you are thinking, Another "get an object to the Mouse thread". I have actually read through most of the relative ones I could find, and no luck. Although, I sifted through a lot of the problems encountered.

What I am currently trying to do is get a object based on the bottom of the screen to shoot a projectile towards the mouse, at any given point on the screen. So far, the only luck Ive had is using SetLinearVelocity and getMousePosition(). But that doesnt work as needed.... Anything below the middle of the screen is aimed down, and side is aimed side, Not exactly the expected results. Im really not even sure if Linearvelocity is what i need to be using, hehe.

Im now in search of a solution to this problem. I was trying to find a way on my own, given a few hours of actually trying to get the ammo to fly. If anyone could be of aid, I would be thankful.

Thanks,
Michael

#1
02/24/2009 (7:42 am)
Try a combination of these 2 behaviors:

1)Face Mouse
2)Mouse Shoots
#2
02/24/2009 (8:34 am)
Wow.... I seriously over looked those.... Thats actually exactly what was needed too, sadly enough. Would have saved, oh, I dont know, 6 hours, hehe. Thank you Simon, I appreciate the help.

Michael