proximity rotation

This commit is contained in:
Rendo 2025-11-13 21:31:06 +05:00
commit 3a6da57079
3 changed files with 23 additions and 12 deletions

View file

@ -13,7 +13,7 @@ height = 0.7
[sub_resource type="CylinderMesh" id="CylinderMesh_627mb"]
top_radius = 0.1
bottom_radius = 0.1
bottom_radius = 0.08
height = 0.5
[node name="DraggableObject" type="Area3D"]
@ -23,6 +23,9 @@ script = ExtResource("1_vcwhe")
shape = SubResource("SphereShape3D_vcwhe")
[node name="InteractionArea" type="Area3D" parent="."]
collision_layer = 2
collision_mask = 2
input_ray_pickable = false
script = ExtResource("2_627mb")
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractionArea"]
@ -31,8 +34,10 @@ shape = SubResource("CapsuleShape3D_vcwhe")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("CylinderMesh_627mb")
[node name="ProximityRotator" type="Node" parent="."]
[node name="ProximityRotator" type="Node" parent="." node_paths=PackedStringArray("rotated")]
script = ExtResource("3_00eeh")
rotated = NodePath("../MeshInstance3D")
proximity_radius = 0.496
[connection signal="drag_ended" from="." to="InteractionArea" method="request_interaction"]
[connection signal="interaction_reciever_entered" from="InteractionArea" to="ProximityRotator" method="_on_interaction_area_interaction_reciever_entered"]

View file

@ -10,6 +10,9 @@ height = 1.0
radius = 0.75
[node name="InteractibleObject" type="Area3D"]
collision_layer = 2
collision_mask = 2
input_ray_pickable = false
script = ExtResource("1_auicg")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]