Good morning, everyone!
I’m new to this world of Unity and as a result I’m learning the basics
Here is my problem that I think is simple to solve ![]()
private void OnCollisionEnter2D(Collision2D collision2D)
{
if (!collision2D.gameObject.name.Equals("Plafond"))
{
rb2d.velocity = Vector2.zero;
isDead = true;
//Joue l'animation "Die"
anim.SetTrigger("Die");
//On appelle notre GameControl, la fonction de la mort
GameControl.instance.BirdDie();
}
else
{
bird.transform.eulerAngles.Set(0, 0, 0);
}
}
In fact, in the else, I would like “bird” to have a rotation of 0 on the Z axis, so that it can be straight.
Is that possible? The code I made doesn’t work
Thank you!