Elevator anticrush

This commit is contained in:
Marco 2025-09-17 15:44:45 +02:00
commit d3edb4de99
5 changed files with 620 additions and 107 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://b3io3bage2qyb"]
[gd_scene load_steps=8 format=3 uid="uid://b3io3bage2qyb"]
[ext_resource type="Script" uid="uid://2fm2civ8ihgs" path="res://Scripts/Actors/ElevatorProxy3D.cs" id="1_buenw"]
[ext_resource type="Script" uid="uid://cyr7ypanl8drq" path="res://Scripts/Actors/Elevator3D.cs" id="1_sjscu"]
@ -15,6 +15,9 @@ point_count = 2
[sub_resource type="CylinderShape3D" id="CylinderShape3D_buenw"]
height = 0.342773
[sub_resource type="BoxShape3D" id="BoxShape3D_buenw"]
size = Vector3(1.9282227, 0.47607422, 1.9619751)
[node name="Elevator" type="Path3D" node_paths=PackedStringArray("Elevator")]
curve = SubResource("Curve3D_buenw")
script = ExtResource("1_buenw")
@ -41,3 +44,15 @@ OneTime = false
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Elevator/AreaTrigger3d"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.23584, 0)
shape = SubResource("CylinderShape3D_buenw")
[node name="ActorCrushDetection" type="Area3D" parent="Elevator"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.21122858, 0)
collision_layer = 0
collision_mask = 66
[node name="CollisionShape3D" type="CollisionShape3D" parent="Elevator/ActorCrushDetection"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.008544922, -0.2619629, -0.005340576)
shape = SubResource("BoxShape3D_buenw")
[connection signal="area_entered" from="Elevator/ActorCrushDetection" to="PathFollow3D" method="OnActorCollision"]
[connection signal="body_entered" from="Elevator/ActorCrushDetection" to="PathFollow3D" method="OnBodyCollision"]