One Way of Platform effector 2D doesn't work.

Hey

So basically it does work. But when I stand on the platform and switch the rotation 180 degrees my player doesn’t fall.

if (Input.GetKeyDown(KeyCode.S))
        {
            gameObject.GetComponent<PlatformEffector2D>().rotationalOffset = 180;
        }
        if (Input.GetKeyUp(KeyCode.S))
        {
            gameObject.GetComponent<PlatformEffector2D>().rotationalOffset = 0;
        }
}

This is the code I use for that though I don’t think the problem lies there as I can see in scene view that the rotationalOffset did change correctly. Also, if I press the key S before I land on the platform it works. It only malfunctions if I already stand on the platform.
Did anyone else have this problem? Or are there some ideas where this sort of behavior comes from?

Thanks in advance :slight_smile:

Is your player a Rigidbody2D? Is it falling asleep? If so, set it to not fall asleep.

1 Like

I have tried that and it didn’t work, though I think this was actually the problem and I fixed it wrong. Anyway, I found another way to do it and it works now.