Quantcast
Channel: Questions in topic: "side-scrolling"
Viewing all articles
Browse latest Browse all 99

How to remove gravity when click

$
0
0
So I have this script in which when I click the gravity turns -1 and it stays that way until I click again, but I want the gravity to go back to normal the moment my click ends. Just like flappy birds. function Update () { if(Input.GetButtonDown("Fire1")) { Physics.gravity *= -1; } }

Viewing all articles
Browse latest Browse all 99

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>