How Can I Let Enemys Move In A Random Direction?

Discussion in 'Buildbox 3.0' started by Kaius, Sep 5, 2019.

  1. Kaius

    Kaius Boxer

    Joined:
    Aug 25, 2019
    Messages:
    9
    Likes Received:
    0
    Hi there,

    I've got some ennemys (balls), they sould move around randomly. But I don't get it. In this top down view game the enemy moves in one direction and stops at the border. That's it. I want it to bounce of this border/wall into another directon and so on. Any idea?

    Best greetings,
    Kai
     
  2. AaroArts

    AaroArts Miniboss Boxer

    Joined:
    Jun 22, 2016
    Messages:
    1,546
    Likes Received:
    826
    You can check for a collision using ‘If Collide node.
    Upon the collision, you can then set a random velocity using Math.random().
     

Share This Page