45 lines
1.4 KiB
Text
45 lines
1.4 KiB
Text
[gd_scene format=3 uid="uid://bmibf31n8lo2l"]
|
|
|
|
[ext_resource type="Material" path="res://assets/materials/kaleidoscope_mosaic_red.tres" id="1_c1bky"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_exgcw"]
|
|
resource_name = "Projectile"
|
|
script/source = "extends Area3D
|
|
|
|
@export var speed : float = 50.0
|
|
|
|
func _physics_process(delta : float):
|
|
global_position += -global_basis.z * speed * delta
|
|
$MeshInstance3D.global_rotation = global_position * 10.0
|
|
|
|
|
|
func _on_body_entered(body: Node3D) -> void:
|
|
if is_queued_for_deletion():
|
|
return
|
|
queue_free()
|
|
var player := body as PlayerBody
|
|
if not player:
|
|
return
|
|
player.damage()
|
|
"
|
|
|
|
[sub_resource type="BoxMesh" id="BoxMesh_exgcw"]
|
|
material = ExtResource("1_c1bky")
|
|
|
|
[sub_resource type="SphereShape3D" id="SphereShape3D_exgcw"]
|
|
radius = 0.18299815
|
|
|
|
[node name="Projectile" type="Area3D" unique_id=1928044182]
|
|
collision_mask = 15
|
|
script = SubResource("GDScript_exgcw")
|
|
speed = 25.0
|
|
|
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=447127444]
|
|
transform = Transform3D(0.23963927, -0.042289857, -0.18552783, -0.07803772, 0.2502626, -0.15784405, 0.17354865, 0.17092746, 0.18520437, 0, 0, 0)
|
|
mesh = SubResource("BoxMesh_exgcw")
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1174190454]
|
|
shape = SubResource("SphereShape3D_exgcw")
|
|
debug_color = Color(0.97529346, 0, 0.42398593, 0.41960785)
|
|
|
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|