Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Make an object come on the screen at random angles from random sides

Discussion in 'Scripting' started by MH1, May 24, 2013.

  1. MH1

    MH1

    Joined:
    Mar 31, 2013
    Posts:
    7
    I want the enemy to come on the screen at random angles from random sides etc. I only use c#!
    Any Suggestions?
     
  2. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,646
    Yes. Asking your question here
     
  3. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,566
    Just spawn them random around the player
     
  4. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,422
    An easy way is to create a set of child transforms around the player, then randomly spawn the enemies at one of those transforms.
    Or you can just do some random vector calculations based on a player offset.