jeudi 21 décembre 2017

teleporting a game object to a position if a variable is a certan value

Hi im trying to make a game object change its position if a variable is eaquel to

void awake()
{
    if(GameControllerScript.CardNumber == 1)
    {       
        transform.position = new Vector3(8f, 6.89f, 9f);
    }
    sr = GetComponent<SpriteRenderer>();

}

I was wondering if anyone knew what is wrong here?

Aucun commentaire:

Enregistrer un commentaire