Making an Enemy follow your Y axis

RSoftwareUKRSoftwareUK Member, PRO Posts: 44

If you look at the image. I am trying to make the blue enemy follow my balloon sprite, but I don't want it to be as obvious as using the constraint attribute. I want it to follow more like it doesn't know which direction I am going to go (like real life).

I tried Constraint and it doesn't look very good.

Anyone any ideas? Thank you.

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited April 2014

    Track the red balloon's y position with a game attribute called redY

    Use the following constraint in the blue balloon:

    Constrain Attribute: self.Position.Y To: self.Position.Y +( game.redY - self.Position.Y )*.01

  • opaopa Member Posts: 35

    Try to use Accelerate toward instead of constraining.

Sign In or Register to comment.