Change Enemy Direction

Discussion in 'How Can I...?' started by knut22, Oct 17, 2016.

  1. knut22

    knut22 Boxer

    Joined:
    Aug 15, 2016
    Messages:
    16
    Likes Received:
    0
    How can I make an enemy change direction when it collide with another enemy?
     
  2. blackswan

    blackswan Avid Boxer

    Joined:
    Nov 14, 2015
    Messages:
    109
    Likes Received:
    45
    I would recommend you watch the online tutorial videos they cover this.

    Basically...
    Attach a Transform Logic piece to each of your enemy objects, set the Linear Velocity to -1, Affected Assets to Enemy and lastly Affect Operation to Multiply.

    Now when your enemy is traveling at a linear velocity of e.g 10 in the x direction comes in contact with another enemy it will collide with the Transform piece, its linear velocity is multiplied by -1 which makes it -10 in the x direction i.e opposite direction.
     

Share This Page