I'm working on a 2D BMX game with flips and spins and I'd like to make it so if the bike lands at the wrong angle it'll crash and restart at the checkpoint. For testing purposes I've tried to make it so the character will restart at the nearest checkpoint when it hits a certain angle. The relevant script is
public float Landing;
void Update()
{
Landing = transform.rotation.eulerAngles.y;
}
if ( Landing == 100)
{
reset
}
I've also tried
If(transform.rotation.eulerAngles.y == 100)
but that's not working either. Unity is showing no errors in my script.