DreamBall/elements/ring.tscn
2025-02-22 17:16:30 +01:00

30 lines
817 B
Text

[gd_scene load_steps=3 format=3 uid="uid://cpm3laywhlbq5"]
[sub_resource type="GDScript" id="GDScript_86vhg"]
script/source = "extends CSGTorus3D
var collected = false
func _on_area_3d_body_entered(body: Node3D) -> void:
if collected == false and body.name == \"Sphere\":
print(\"YES \", body)
collected = true
"
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tgirv"]
radius = 4.0
[node name="Ring" type="CSGTorus3D"]
use_collision = true
inner_radius = 4.0
outer_radius = 8.0
sides = 16
ring_sides = 8
script = SubResource("GDScript_86vhg")
[node name="Area3D" type="Area3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("CylinderShape3D_tgirv")
[connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"]