stop actor when move to and rotation
hello,
i need to rotate an airplane on the direction where it is going...how can i do it???
second: this airplane when touched must do an animation but it continue to go (he has a behavior "move to") and i can't stop it to make an explosion arrest! how can i fix it?
than you very much and sorry for my english
i need to rotate an airplane on the direction where it is going...how can i do it???
second: this airplane when touched must do an animation but it continue to go (he has a behavior "move to") and i can't stop it to make an explosion arrest! how can i fix it?
than you very much and sorry for my english
Comments
update: i uploaded a video on youtube to show what i intend....the airplane isn't turn to the direction where it's going... and the explosion continue after i destroy the airplane...how can i fix it??
Constrain Attribute: self.rotation To: vectorToAngle(self.Motion.Linear Velocity.X,self.Motion.Linear Velocity.Y)
Hope this helps!
RThurman
If you already have the x,y coordinates for your moveTo behavior, then also use the same coordinates on a rotateTo behavior. Just rotate the plane and then send it on its way.
To stop, It is probably easiest to spawn a non-moving 'explosion' actor. Then immediately destroy the plane. (But explosions actually do travel with the plane for a brief time. What you already have looks correct to me.)
Hope that helps!
RThurman