jeudi 14 décembre 2017

Random.Range GameObject Rotation

I want to do something and I don't even come out. I have a sprite. When I start I want it to be rotated to a random position of these (90f, -180f, -90f). for example give the start, its position is -90f on the z axis, or -180f, or 90f. I am a beginner and I do not know too much. Help!!!

public GameObject sprite;

void Start()
{
    //random z position (90f, -180f, -90f)
    //sprite.transform.Rotate
}




Aucun commentaire:

Enregistrer un commentaire