Search Unity

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,649
    Yes. Asking your question here
     
  3. stanislav-osipov

    stanislav-osipov

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

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    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.