Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Fire Ball Random Movement Implementation

Discussion in '2D' started by siddharth3322, Jun 22, 2019.

  1. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    I was working on Donkey Kong kind of reference game:


    In this, I can't able to understand what to write for Fire Ball implementation!!
    I am pointing towards this object:

    fire_ball_donkey_kong.PNG

    This fireball object moving randomly in all directions so what to write in code to achieve something similar?
     
  2. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    Set a random direction you want to move in, and move in that direction for a random period of time. Then, change that direction and time to move.