Player does not recognize collision for assets

Godot Version

v4.3

Door Animation Loops when Player Colides with Door.

I created a Sprite2D animation called door_open_anim. I created a signal for an Area2D node called front_door_open called _on_body_entered. For _on_body_entered, here is my trigger_01.gdscript for it below.

extends Area2D

@onready var door_open_anim = $door_open_anim

func _on_body_entered(_body:Node2D) -> void:
	door_open_anim.play()

How can I keep the sprite animation from looping?

Set your loop mode here:


(AnimatedSprite2D)


(AnimationPlayer)

That is awesome. I notice however that I can still play the Sprite Animation more than once when the player touches it again. How do I keep that from happening?

var is_open : bool = false
@onready var door_open_anim = $door_open_anim

func _on_body_entered(_body:Node2D) -> void:
	if !is_open:
		is_open = true
		door_open_anim.play()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.