Behind

igpxnaruto4igpxnaruto4 Member Posts: 81
edited November -1 in Tech Support
how do i make it so that when i have an actor moving... for example a car, how do i make it so theres flames behind it? what i mean is i have 2 images made, ones a car, the other one is fire, how do i make it so that when the actor moves the flame is allways right behind it following in the same derection as the car?

Comments

  • creativeappscreativeapps Member Posts: 1,770
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    Use the Constrain Attribute behavior to constrain the X and Y positions of the flames actor to the X and Y positions of the car actor (you can include offsets to make the flames constrained to the end of the car and not the middle of the car).

    * Create 2 game attributes (integers) called carX and carY.

    * In the car actor, constrain attribute game.carX to self.Position.X and constrain attribute game.carY to self.Position.Y.

    * In the flames actor, constrain attribute self.Position.X to game.carX and constrain attribute self.Position.Y to game.carY. To offset the flames, add/subtract a value (e.g. self.Position.X to game.carX-20). This will move the flames 20 pixels left from the car's center.

    - Jeff
Sign In or Register to comment.