-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenus.gd
More file actions
30 lines (21 loc) · 820 Bytes
/
menus.gd
File metadata and controls
30 lines (21 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
extends Node
var vr = false
var desktop = false
var vr_scene_path = "res://Spatial.tscn" # Replace with your VR scene path
var desktop_scene_path = "res://Spatial.tscn" # Replace with your desktop scene path
var vr_player_path = "res://vrplayer.tscn" # Replace with your VR player path
var desktop_player_path = "res://player/player.tscn" # Replace with your desktop player path
func _ready():
pass
func _on_vr_pressed():
vr = true
desktop = false
get_tree().change_scene_to_file(vr_scene_path)
var vr_player = load(vr_player_path).instantiate()
get_node("/root").add_child(vr_player)
func _on_desktop_pressed():
desktop = true
vr = false
get_tree().change_scene_to_file(desktop_scene_path)
var desktop_player = load(desktop_player_path).instantiate()
get_node("/root").add_child(desktop_player)