First Person Controller gravity changing script.

Hi, for my game, I have created a Zero Gravity GUI Button and I need help on making a script for it so that when I click it, it will change the gravity to 2 and when you click it again, it will change back to 20. Thanks, Dean_0707

Why don’t you make animation instead of changes gravity?

You could create an if statement in the onClick script. Set up a boolean variable for gravity. Then check to see if gravity is on or off.
Then set the rest of the function up accordingly.