how to make an object following another ?

Hi,

How to make something like a pursuit with 2 objects in the BGE ?

Thanks

Alain

second objet “track to” first objet.

Give a velocity to the second objet, to make it moves.

yeah, what i do is, on the first object, press F4, give it a property, make sure you name the object too, then on the enemy object, add a radar sensor, set the angle to like 180, and distance as far as you want, type the name of the property of your original object and try pressing the true pulse mode button, i think that will make him follow whenever you are within the range you set, then, connect an “And” controller and do and “Edit object” “Track to” actuator, then add another actuator below the “track to” actuator, make it a “Motion” actuator, adjust the settings to make it move forward, then it should work perfectly, if u want to make it better, u can have separate animations for when the enemy spots you, or when the enemy reaches you also.

read this
http://download.blender.org/documentation/NaN_docs/BlenderGameReference/logicbricks.html

As soon as I saw this thread that was my exact idea =] Great minds think alike :wink:

wow thanks, i didnt know i was great lol, i just started using blender last month haha

Thanks …Great technique…

But, another problem…
Now my ennemy is always following my character…oups…
How can I escape from him ? (stop the pursuit if I run away …)?

Alain

you have to get out of range of the ray sensor, if you turn on physics visualizations i think its called, in the “game” menu up at the top you should be able to see the range of the sensor in BGE

yea, set the range, if its like “10” it will only folo u when you are within 10 units og the enemy