You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 3 scenes. A main Scene that has the a level as child and manages the adding and removing of levels, and two levels: a red level and a green level. The red_level gets removed and re-added every time, the green_level(s) gets instanced, added and then queued free.
The weird thing is whenever the red_level gets added back to the SceneTree, the Area2D detects the player body, even though I have set the position of the player body away from the Area before even removing the red_level scene.
What does make a difference though, is to yield timeout before the signal is emitted, but only if the timeout is long enough as user "sushi" on Discord figured out:
func _on_AnimationPlayer_animation_finished(_anim_name):
$player.position = Vector2(128, 256)
stage_number += 1
$Label.text = str("stage ", stage_number)
$Area2D/ColorRect.modulate.a = 1.0
yield(get_tree().create_timer(0.1), "timeout") #0.01 would have no effect
call_deferred("emit_signal","signal_next_level")
@Zireael07 What do you mean by "things"? The Area too? This seems like really unclean and unreliable behavior to me. I would understand if it's in the same frame, but this I don't understand.
Godot version: 3.2.1
OS/device including version: Win64
Issue description:
I have 3 scenes. A main Scene that has the a level as child and manages the adding and removing of levels, and two levels: a red level and a green level. The red_level gets removed and re-added every time, the green_level(s) gets instanced, added and then queued free.
The weird thing is whenever the red_level gets added back to the SceneTree, the Area2D detects the player body, even though I have set the position of the player body away from the Area before even removing the red_level scene.
This is a bit difficult to explain, best to look at the minimal project.
If makes no difference if the signal_next_level is call_deferred() or not.
What does make a difference though, is to yield timeout before the signal is emitted, but only if the timeout is long enough as user "sushi" on Discord figured out:
Possibly related issue:
#34085
also possibly related: #27441 (comment)
Steps to reproduce:
Walk the player into the area in the middle.
Minimal reproduction project:
Area2D_enter_on_remove_bug.zip
The text was updated successfully, but these errors were encountered: