I'm new to programming and to Godot.
My code for my player is working fine including gravity "velocity.y += GRAVITY"
However for an enemy, gravity is not working the same.
The y values 50 each below is simply for me to understand where is the problem, the enemy simply goes on a straight line when I would like gravity to pull further down.
I'm guessing there is a problem with the line "velocity.y += GRAVITY", I don't know.
Here is the code:
(the commented part probably has no connection, ignore)
const GRAVITY = 50
export var jumpheight = -50
export var jumpreach = -150
var velocity = Vector2()
#var jumping_enabled = false
velocity.y = jumpheight
velocity.x = jumpreach
velocity.y += GRAVITY
# if jumpingenabled == true:
*# velocity.y = jumpheight
# velocity.x = jump_reach
*# velocity.y += GRAVITY**
velocity = move_and_slide(velocity)
*# jumping_enabled = true**