If i have a player and lets say a red ball hits my player and the player goes on fire...ok easy enough i did that but now i wanna add to the code below under the IF statement that a blue ball hits my player and freezes or a black ball and causes death animation...but its just not working out to add multiple animation events to 1 player. I just started coding 4 months ago so im green but thanks to all who read and helped.
public GameObject GoneGo;
void OnTriggerEnter2D(Collider2D collisionObject)
{
if (collisionObject.gameObject.tag == "Orb")
{
PlayGone();
}
}
void PlayGone()
{
GameObject gone = (GameObject)Instantiate(GoneGo);
gone.transform.position = transform.position;
}
}
Aucun commentaire:
Enregistrer un commentaire