Hello, everyone. I reopened a project that was in my project graveyard, hoping to give it life once again. The code works fine until I add gravity.
var motion = Vector2(0,0)
const SPEED = 1000
var GRAVITY = 500
const UP = Vector2(0, -1)
const JUMP_SPEED = 1000
func apply_gravity():
if not is_on_floor():
motion.y += GRAVITY
else:
motion.y = 0
This should be easy, but for some reason, the code won't switch motion.y to 0. Any help on this would be greatly appreciated!