Missile with a target

Hi,

I speak french so I don’t know how to tell this in english but I want to do a missile that will try to reach a moving target. (Heat seeking missile I think)

In my game, I just tried to give the missile à “base” target (not moving) but it do not work.

The target is a modelnode. Is there a way to tell an objet (my missile) to try to reach a target (enemy ship for example)???

My problem is that the enemy ship is totally in another branch of the scene graph, they are not related… Eum… I read myself and that must be so confusing… I’m sorry. Just ask question if you don’t understand.

Here is the code in my missile right now (It only move the missile forward).

def move(self, elapsed):
        self.totalElapsed += elapsed
        
        if (self.totalElapsed < self.autodestruction):
            self.root_phantom.setFluidPos(self.root_phantom,Vec3(0,-self.speed*elapsed,0))
        else:
            self.root_phantom.removeNode()
            self.isDead = 1

This is called each frame.

Thanks

Jaff

What about this:

self.root_phantom.lookAt(other_object)

I will try that, it should be working!

Thanks

Jaff