Player can't move while on a moving platform

Viewed 96

I have code that moves the player with the moving platform. It works but the problem is that I can't move the player when the controls are disabled. Can anyone show some solutions

void OnCollisionEnter(Collision other)
{
    if(other.gameObject == Player){
        on = true;
        Player.transform.parent = gameObject.transform;
    }
}
void OnCollisionExit(Collision other)
{
    on = false;
    Player.transform.parent = null;
}
0 Answers
Related