Not sure why this is happening, but after the platform disappears my character does not fall but just floats on the platform.
extends StaticBody2D
onready var animation_player = $AnimationPlayer
onready var player_detector = $PlayerDetector
func _ready() -> void:
player_detector.connect("body_entered", self, "_on_Player_detector_body_entered")
func _on_Player_detector_body_entered(body : Node) -> void:
animation_player.play("fade")
I'm having the same issue. I've triple checked the animation player, cod, collision shapes. Maybe there's something I'm missing? Please help!
extends StaticBody2D
onready var animation_player := $AnimationPlayer
onready var player_detector := $PlayerDetector
func _ready() -> void:
player_detector.connect("body_entered", self, "_on_PlayerDetector_body_entered")
func _on_PlayerDetector_body_entered(body: Node) -> void:
animation_player.play("fade")
I've tried remaking the animation player. The platform now disappears and the robot falls from it but only once. Stepping on it once more doesn't trigger any animation.
EDIT
In order to fix it I had to add following code, connecting the animation finished signal to the animation player:
func _on_AnimationPlayer_animation_finished(anim_name):
if anim_name == "fade":
animation_player.play("RESET")
Maybe it will help someone.