Enemy shooting with track to help?!?!?

I am working on a FPS game and there is a turret with the following setup:

an empty which shoots parented to a gun,
the gun with a timer and near sensors to shoot when the character is near the gun
A track-to actuator to point to the character

Well the problem is that when the track-to is off, the gun shoots fine. But when track-to is set, the empty seems to fly around and shoots from random places…

Does anyone know how to fix this please its URGENT.

It could be a collision issue between the bullet and gun, causing the bullet to ricochet off in a different direction. Move the empty a bit further away from the gun and see if that works.

A blend file is needed to really know what’s going on…

In general, things that use Track-To should be aligned on the Y-axis (as in the Y axis will be the thing that’s pointing towards the other object).

Is the gun dynamic? If so it could be colliding with things (such as the bullet). You could make the bullet a “ghost” object to test.


No thats not the problem but thanks for your help.
Everything works fine until you enable track_to.

Maybe “Track to” misbehaves if non-aligned objects are parented. Did you align the y axes of the gun and the empty before parenting?

Hmmm maybe, I’ll try that!

nup thats not it… well i guess I’ll have to go for close attacks then :stuck_out_tongue:

dude does any 1 know how to make an enemy ai that shoots

@chand17: You could use thisfor some ideas…