Godot Version
4.3!
Question
Hello! Thanks for checking my problem!
I juiced up the death animation from immediately respawning in the last check point to having the classic falling off the screen like in Mario. But for some reason, the character’s collision box is still active despite the script turning it off as seen in the GIF. The animation player doesn’t affect collision, just has animations in rotation for “Death” and transform for “Idle”
func player_death ():
collision_shape_2d.disabled = true #Juice part 1
velocity.y = -1500
animation_player.play("Death")
InUse = false
audio_stream_player.play()
retry_counter += 1 #Score system
add_score(-1000)
camera_shake() #Juice part 2
frame_freeze(0.05, 1.5)
await get_tree().create_timer(1.5).timeout # waits for 1 second
collision_shape_2d.disabled = false #Respawn system
animation_player.play("Idle")
InUse = true
global_position = respawn_position
func _on_area_2d_body_entered(body: Node2D) -> void:
if body.is_in_group("PlayerCharacter"):
body.player_death()