Game Development Community

aiPlayer.cs

by Grant McNeil · in Torque Game Engine · 06/15/2002 (9:40 am) · 2 replies

Okay, can someone show me their aiPlayer.cs? I have been trying to make a bot the follows me where ever the player goes. I tried to do this by using the 'OnReachDestination' function find my new position and go there. The problem is The Bot will get to my position, then stop moving. in the console just constantly says:

OnMove
OnReachDestinaion

I guess this is because its finding the clients position only once, then trying to move to that position. Can someone please show me their aiPlayer.cs and/or shead some light on this situation for me?

#1
06/16/2002 (5:11 pm)
Please answer
#2
06/16/2002 (11:17 pm)
Well, you have to put your movement code into a function and call it in AIPlayer::onAdd() AND in AIPlayer::onReachDestination(%this), so that it keeps looping (each time the bot reaches the player, it starts the function again...)
This should get you started....