This commit is contained in:
sharpoff
2026-01-14 13:01:37 +09:00
commit 49d7e22132
660 changed files with 41243 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
@tool
class_name XRToolsTeleportArea
extends Area3D
## Target node
@export var target : Node3D
# Add support for is_xr_class on XRTools classes
func is_xr_class(xr_name: String) -> bool:
return xr_name == "XRToolsTeleportArea"
# Called when the node enters the scene tree for the first time.
func _ready():
# Handle body entered
body_entered.connect(_on_body_entered)
# Handle body entering area
func _on_body_entered(body : Node3D) -> void:
# Test if the body is the player
var player_body := body as XRToolsPlayerBody
if not player_body:
return
# Teleport the player
player_body.teleport(target.global_transform)