i’m making my first game , a simple one where you tap to change gravity and avoid obstacles
i want to make it so the player switch gravity on mouse touch ( when he’s down he goes up and when he’s up he comes back down )
the problem is i cant find a way to seperate these behaviors , when i click both behaviors get triggered and the player stays on its place
i tried with variables and booleans but i cant get it right
use a variable
at beginning of scene could be 0
when you touch if variable is 0 you change gravity to go up and set vsriable to 1
if you touch again variAble value is 1, so you change gravity and variable value to 0 again
i did it kind of
however there’s still something that i don’t get
i set a condition to on mouse click pressed and set it to trigger only once but the behavior keeps reoccuring , any idea why this happens ?