ButtonTrigger.tscn 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. [gd_scene load_steps=5 format=3 uid="uid://cs5vfev0lasyn"]
  2. [ext_resource type="Script" path="res://entities/objects/button_trigger/ButtonTrigger.gd" id="1_wef4m"]
  3. [ext_resource type="Material" uid="uid://drbi6wjcoybek" path="res://entities/objects/button_trigger/button_gate_material.material" id="2_sw3ka"]
  4. [sub_resource type="BoxShape3D" id="BoxShape3D_8u0rb"]
  5. size = Vector3(0.6, 1.2, 0.6)
  6. [sub_resource type="CylinderMesh" id="CylinderMesh_62jag"]
  7. radial_segments = 7
  8. rings = 2
  9. [node name="ButtonTrigger" type="Area3D" groups=["trigger"]]
  10. collision_layer = 4
  11. collision_mask = 38
  12. script = ExtResource("1_wef4m")
  13. on_enter = {}
  14. on_exit = {}
  15. [node name="CollisionShape3D" type="CollisionShape3D" parent="."]
  16. shape = SubResource("BoxShape3D_8u0rb")
  17. [node name="MeshInstance3D" type="MeshInstance3D" parent="."]
  18. transform = Transform3D(1.22394, 0, 0, 0, 0.05922, 0, 0, 0, 1.22394, 0, 0, 0)
  19. mesh = SubResource("CylinderMesh_62jag")
  20. surface_material_override/0 = ExtResource("2_sw3ka")
  21. [node name="Timer" type="Timer" parent="."]
  22. wait_time = 0.5
  23. one_shot = true
  24. autostart = true
  25. [connection signal="body_entered" from="." to="." method="_on_ButtonTrigger_body_entered"]
  26. [connection signal="body_exited" from="." to="." method="_on_ButtonTrigger_body_exited"]
  27. [connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]