I’m trying to disable my movement script while the player is near the top of the screen. Currently my code is just disabling the script once I get into position and then never enabling itself once gravity takes me below the disabled area.
while(rigidbody2d.position.y <= 5 && rigidbody2d.position.y >= 4.2)
{
this.enabled = false;
break;
}
this is part of the Update method attached to my player object. Not sure what I need to change or add so that it enables itself.