Created first version of SimpleSocket to test socket with SimpleKey (Any pickupable with socket)

This commit is contained in:
2026-09-26 22:19:20 +03:00
parent 6af29d4611
commit 2cc2d59be9
5 changed files with 61 additions and 7 deletions
+5 -2
View File
@@ -1,5 +1,6 @@
[gd_scene format=3 uid="uid://cwwsolupah1s3"]
[ext_resource type="PackedScene" uid="uid://cvipcpeglasek" path="res://Scenes/SimpleSocket.tscn" id="1_grg3l"]
[ext_resource type="PackedScene" uid="uid://cpog4xqme7wqj" path="res://Scenes/Player.tscn" id="1_pbw6q"]
[ext_resource type="PackedScene" uid="uid://hmpweoahtner" path="res://Scenes/Door.tscn" id="2_v1gob"]
[ext_resource type="PackedScene" uid="uid://dgre5brxnbps0" path="res://Scenes/MedievalDoor.tscn" id="3_jw32o"]
@@ -41,6 +42,9 @@ mesh = SubResource("BoxMesh_1blfk")
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=2109163521]
shape = SubResource("BoxShape3D_va8t4")
[node name="SimpleSocket" parent="StaticBody3D" unique_id=1835661048 instance=ExtResource("1_grg3l")]
transform = Transform3D(1, 0, 0, 0, 0.6742996, 0.7384579, 0, -0.7384579, 0.6742996, -11.95581, 1.1145909, 3.0031586)
[node name="Player" parent="." unique_id=1270645855 instance=ExtResource("1_pbw6q")]
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1880837933]
@@ -126,10 +130,9 @@ maxRaycastDistance = 10.0
[node name="SimplePickupable4" parent="." unique_id=1419866814 instance=ExtResource("10_bmxlf")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0351448, 3.2192059)
[node name="SimplePickupable5" type="Node3D" parent="." unique_id=1116791131 node_paths=PackedStringArray("body")]
[node name="SimplePickupable5" type="Node3D" parent="." unique_id=1116791131]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.0500765, 1.2124488, 6.335041)
script = ExtResource("11_4kpch")
body = NodePath("")
bodyMass = 100.0
metadata/_custom_type_script = "uid://b143brnl7gf4f"
+3 -3
View File
@@ -14,7 +14,7 @@ albedo_color = Color(1, 1, 0, 1)
[node name="SimpleKey" type="Node3D" unique_id=650555678 node_paths=PackedStringArray("body", "snapAnchor")]
script = ExtResource("1_rsor3")
body = NodePath("RigidBody3D")
snapAnchor = NodePath("SnapAnchor")
snapAnchor = NodePath("RigidBody3D/SnapAnchor")
metadata/_custom_type_script = "uid://b143brnl7gf4f"
[node name="RigidBody3D" type="RigidBody3D" parent="." unique_id=1946674219]
@@ -28,5 +28,5 @@ shape = SubResource("BoxShape3D_1blfk")
mesh = SubResource("BoxMesh_va8t4")
surface_material_override/0 = SubResource("StandardMaterial3D_w4i4f")
[node name="SnapAnchor" type="Marker3D" parent="." unique_id=389082687]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.15)
[node name="SnapAnchor" type="Marker3D" parent="RigidBody3D" unique_id=389082687]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.15)
+26
View File
@@ -0,0 +1,26 @@
[gd_scene format=3 uid="uid://cvipcpeglasek"]
[ext_resource type="Script" uid="uid://xd03vepkva1l" path="res://Scripts/Socket.gd" id="1_5ldhx"]
[sub_resource type="BoxMesh" id="BoxMesh_1blfk"]
size = Vector3(1, 1, 0.2)
[sub_resource type="BoxShape3D" id="BoxShape3D_1blfk"]
size = Vector3(1, 1, 0.2)
[node name="SimpleSocket" type="Node3D" unique_id=1835661048 node_paths=PackedStringArray("snapPoint", "snapArea")]
script = ExtResource("1_5ldhx")
snapPoint = NodePath("Marker3D")
snapArea = NodePath("Area3D")
metadata/_custom_type_script = "uid://xd03vepkva1l"
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1351826322]
mesh = SubResource("BoxMesh_1blfk")
[node name="Area3D" type="Area3D" parent="." unique_id=792436256]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D" unique_id=1932740275]
shape = SubResource("BoxShape3D_1blfk")
[node name="Marker3D" type="Marker3D" parent="." unique_id=1726119799]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1)