stop actor when move to and rotation

patapplepatapple Member Posts: 873
edited February 2012 in Working with GS (Mac)
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

Comments

  • patapplepatapple Member Posts: 873
    edited February 2012
    Please...i need do it

    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??

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    To get an actor to rotate to the direction it is traveling -- you can use a constrain behavior:

    Constrain Attribute: self.rotation To: vectorToAngle(self.Motion.Linear Velocity.X,self.Motion.Linear Velocity.Y)

    Hope this helps!
    RThurman
  • patapplepatapple Member Posts: 873
    THANKS...it works amazing...do you have any idea about my second question? :)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited February 2012
    Here is another way that might not be as taxing on the system as a constrain behavior. (The constrain behavior constantly fires and can slow down the system.)

    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
Sign In or Register to comment.