21 lines
442 B
GDScript
21 lines
442 B
GDScript
extends Area3D
|
|
|
|
## Target festlegen
|
|
@export_file("*.tscn") var target_szene : String
|
|
|
|
func _ready():
|
|
body_entered.connect(_on_body_entered)
|
|
|
|
|
|
func _on_body_entered(_body : Node3D) -> void:
|
|
if not target_szene or target_szene == "":
|
|
return
|
|
# Finde die Szene
|
|
var szene_base : XRToolsSceneBase = XRTools.find_xr_ancestor(self, "*", "XRToolsSceneBase")
|
|
|
|
if not szene_base:
|
|
return
|
|
|
|
# Starte Szene
|
|
szene_base.load_scene(target_szene)
|