hide world forground on first frame

This commit is contained in:
Nordup 2025-08-23 20:56:18 +07:00
parent 52588770a4
commit 1ad079704b
3 changed files with 8 additions and 22 deletions

View file

@ -12,7 +12,7 @@ var _visible: bool = true
func _ready() -> void:
command_events.set_mouse_mode.connect(set_mouse_mode)
gate_events.first_frame.connect(func(): gate_started = true)
gate_events.first_frame.connect(on_first_frame)
gate_events.not_responding.connect(func(): set_mouse_mode(Input.MOUSE_MODE_VISIBLE))
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
@ -30,6 +30,11 @@ func _input(event: InputEvent) -> void:
show_ui()
func on_first_frame() -> void:
gate_started = true
hide_ui()
func show_ui() -> void:
if _visible: return
_visible = true