Adding scene teleporter
Deploy Promiscuity Auth API / deploy (push) Successful in 46s
Deploy Promiscuity Character API / deploy (push) Successful in 46s
Deploy Promiscuity Locations API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 8s

This commit is contained in:
2026-03-06 12:34:59 -06:00
parent 2850c26657
commit 0a8cf20de9
12 changed files with 229 additions and 286 deletions
@@ -0,0 +1,39 @@
extends Area3D
@export_file("*.tscn") var target_scene_path := "res://scenes/Levels/transportation_level.tscn"
@export var target_group: StringName = &"player"
@export var one_shot := true
var _is_transitioning := false
func _ready() -> void:
body_entered.connect(_on_body_entered)
func _on_body_entered(body: Node) -> void:
if _is_transitioning:
return
if target_group != StringName() and not body.is_in_group(target_group):
return
if target_scene_path.strip_edges() == "":
push_warning("Teleporter target scene is empty.")
return
if not ResourceLoader.exists(target_scene_path):
push_warning("Teleporter target scene does not exist: %s" % target_scene_path)
return
_is_transitioning = true
if one_shot:
set_deferred("monitoring", false)
call_deferred("_deferred_change_scene")
func _deferred_change_scene() -> void:
var err := get_tree().change_scene_to_file(target_scene_path)
if err == OK:
return
push_warning("Failed to change scene to '%s' (%s)." % [target_scene_path, err])
_is_transitioning = false
if one_shot:
set_deferred("monitoring", true)
@@ -0,0 +1 @@
uid://dyvldjfan2beq
@@ -0,0 +1,32 @@
[gd_scene load_steps=4 format=3]
[ext_resource type="Script" path="res://scenes/Interaction/scene_teleporter.gd" id="1_tele"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tele"]
height = 3.0
radius = 1.5
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tele"]
transparency = 1
shading_mode = 0
albedo_color = Color(0.15, 0.95, 1, 0.25)
emission_enabled = true
emission = Color(0.1, 0.9, 1, 1)
emission_energy_multiplier = 1.5
[sub_resource type="CylinderMesh" id="CylinderMesh_tele"]
material = SubResource("StandardMaterial3D_tele")
top_radius = 1.6
bottom_radius = 1.6
height = 3.0
[node name="SceneTeleporter" type="Area3D"]
collision_layer = 2
collision_mask = 1
script = ExtResource("1_tele")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CylinderShape3D_tele")
[node name="Visual" type="MeshInstance3D" parent="."]
mesh = SubResource("CylinderMesh_tele")