How Do I stop a scene object?
by Brandon · in Torque X 2D · 02/08/2009 (12:28 pm) · 2 replies
If I have a scene object that just has the AIChase component how can I stop it after it gets started chasing?
In other words I want it to just stand still the entire time, but if the enemy comes into range chase after it, but then if the enemy goes out of range stop right where you are, don't go back to the starting point.
Currently if I run this and my player gets out of range the scene object stops chasing, but the velocity keeps it moving.
I've tried _sceneObject.Physics.Velocity = new Vector2(0,0); But that does not stop it.
In other words I want it to just stand still the entire time, but if the enemy comes into range chase after it, but then if the enemy goes out of range stop right where you are, don't go back to the starting point.
Currently if I run this and my player gets out of range the scene object stops chasing, but the velocity keeps it moving.
I've tried _sceneObject.Physics.Velocity = new Vector2(0,0); But that does not stop it.
#2
02/08/2009 (5:26 pm)
If you're using the PSK anything that is an Actor has a _horizontalStop method that stops Actors dead in their tracks.
Torque Owner Brandon
cod3r on irc