Homing Bullets

Hello everyone.

I’m still working on that raptor game, where you play as a raptor. The raptor fights enemies mostly by shooting balls of energy at them. I seem to be having a problem, however, with the balls of energy actually hitting the enemies. With some careful aiming, they come rather close, but they act pretty dumb, if you know what I mean. So I’ve been trying to add some logic bricks to the balls of energy so they home in on enemies. I’ve done things like have an always sensor, or a radar sensor, linked with an edit object actuator with the “track-to” function. Doesn’t seem to work right at all.

Can anyone give me pointers on how to set up logic bricks so that when the raptor is facing more or less directly at an enemy that balls of energy go straight for the enemy? Also, I plan to have multiple kinds of enemies in this game, so if I had to use the Track to in the edit object actuator, how would that work?

I appreciate all and any help. Thank you.:slight_smile:

First you’d have to “get” the object that is not only in line, but whichever is closet. Python is the only way for this, but I’m not too sure how to do it, as the Radar sensor causes crashes (although it would work well in theory). Then you’d edit the TrackTo actuator (act.setObject(“OBName”), look elsewhere for more details) so the ball would track to the close and in-line object.

sorry to bump this,
but im facing the same problem,
selfstudent,if u have found a solution to this,please let me know,
if anyone else knows a workaround…will appreciate it