Description:
SFXLayer tries to add its sound effect player to the scene while it's being reloaded
To recreate:
Run a scene with Mario and UI funny_slope_test.tscn, spam the reset button and X button (spin attack) repeatedly until you receive the error.
The Error:Cannot call method 'get_tree' on a previously freed instance.
The code it points to:
res://util/sfx_layer.gd
func play_sfx_at(node: Node):
var timer: SceneTreeTimer = node.get_tree().create_timer(delay_time)
await timer.timeout
var player := AudioStreamPlayer.new()
new_pick = sfx_list.pick_random()
if force_new and sfx_list.size() > 1:
while new_pick == last_pick:
new_pick = sfx_list.pick_random()
if overwrite_other:
node.get_tree().call_group(bus, &"queue_free") < HERE
Cause of error:
Playing a sound effect on the same frame that the scene is being reloaded.
Description: SFXLayer tries to add its sound effect player to the scene while it's being reloaded
To recreate: Run a scene with Mario and UI
funny_slope_test.tscn
, spam the reset button and X button (spin attack) repeatedly until you receive the error.The Error:
Cannot call method 'get_tree' on a previously freed instance.
The code it points to:res://util/sfx_layer.gd
Cause of error: Playing a sound effect on the same frame that the scene is being reloaded.