How to reload a scene without a flicker

Godot Version

Godot 4.2.1

Question

I am trying to reload a scene when the player dies. Everything else is working, but when I reload the scene, there’s a time when it does not play animations. Here’s a video.


I am reloading using the reload_current_scene() function.

can you post your code

1 Like

@shatteredreality

func die():## does death animation and disables player
	_disable_all()
	await get_tree().process_frame
	Animationplayer.play("Death")
	await Animationplayer.animation_finished
	await get_tree().create_timer(2).timeouts
	_respawn()
func _enable_all():## enables all non-visual mechanics, visuals handled by animation.
	coyote_timer.start()
	collision_shape.set_deferred(&"enabled",true)
	my_detectable_area.enable()
	enabled=true
	set_physics_process(enabled)
func _on_first_spawn():
	Animationplayer.play("Spawn")
	await Animationplayer.animation_finished
	coyote_timer.timeout.connect(_set_coyote_false)
	_enable_all()
func _disable_all():## disables all non-visual mechanics, visuals handled by animation.
	coyote_timer.stop()
	collision_shape.set_deferred(&"enabled",false)
	my_detectable_area.disable()
	enabled=false
	set_physics_process(enabled)
func _respawn():## does spawn animation and enables player
	get_tree().reload_current_scene()