In my code I am trying to create transitions for some new animations in a match statement. Adding anything after states.fall
gives me the ": expected at end of line."
error.
I tried playing around with my code formatting but to no avail.
Here's the full function:
func _get_transition(delta):
match state:
#inactive state transistions
states.idle:
if !parent.is_on_floor():
if parent.motion.y < 0:
return states.jump
elif parent.motion.y > 0:
return states.fall
elif parent.motion.x > parent.move_speed - 128 or parent.motion.x < -parent.move_speed + 128:
return states.run
states.run:
if !parent.is_on_floor():
if parent.motion.y < 0:
return states.jump
elif parent.motion.y > 0:
return states.fall
elif parent.motion.x < parent.move_speed - 128 and parent.motion.x > -parent.move_speed + 128:
return states.idle
states.jump:
if parent.is_on_floor():
return states.idle
elif parent.motion.y >= 0:
return states.fall
states.fall:
if parent.is_on_floor():
return states.idle
elif parent.motion.y <= 0:
return states.jump
#1h active state transitions
states.1h_run:
if combat_mode == true:
return states.1h_run
return null