Sry, my bad. I cut it to the relevant parts.
The Player.gd
var JUMP_HEIGHT = Globals.JUMP_HEIGHT # globals singleton
func _physics_process(delta):
#The jump part
if is_on_floor():
if Input.is_action_just_pressed("ui_up"):
motion.y = JUMP_HEIGHT
if friction == true:
motion.x = lerp(motion.x, 0, 0.1)
The jump_potion.gd
func _on_Jump_Potion_body_entered(body):
set_process(true)
if body.name == "Player":
Globals.JUMP_HEIGHT = -1000
$Timer.start()
print("AREA ENTERED")
queue_free()
else:
pass
func _on_Timer_timeout():
Globals.JUMP_HEIGHT = -600
The globals.gd (singleton)
var JUMP_HEIGHT = -600