We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 661ff9f commit 55429c8Copy full SHA for 55429c8
1 file changed
scripts/player.gd
@@ -84,7 +84,11 @@ func _ready():
84
# Initialize touch controls if on mobile
85
if OS.has_feature("mobile") or OS.has_feature("web"):
86
touch_controls = touch_controls_scene.instantiate()
87
- get_tree().root.add_child(touch_controls)
+ var ui_root := get_tree().root.get_node_or_null("Node3D/UI")
88
+ if ui_root:
89
+ ui_root.add_child(touch_controls)
90
+ else:
91
+ get_tree().root.add_child(touch_controls)
92
touch_controls.joystick_input.connect(_on_joystick_input)
93
94
# Get reference to pause menu from UI
0 commit comments