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 Code (CSharp): 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!
When you say doesn't work, what does it mean? What happens? Is else even called? Put Debug.Log there and check. Or use BreakPoints in VS for debugging, to go step by step.
Yes, I see-it in the console but I think I found out why it doesn't work, I have to put it in my Update function