Swimming script?????

Hi! I’m trying to make my character swim. I am following this video step by step but it is not working.

How would one go about making their character swim, then?

I didn’t watch the video but when I wanted my guy to swim I put a big collider over around the body of water set to trigger.

When your character is inside the trigger area his rigidbody.useGravity == false so he won’t fall anymore and it triggers the bool underWater to true.

When underWater is true instead of jumping, spacebar would just make you go up for example and instead of crouching you would move down at a certain speed.

When you are outside of the trigger your rigidbody is set to use gravity again and underWater goes to false and you go back to normal key configuration.