Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts/bullet.gd
diff options
context:
space:
mode:
authorLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-17 22:02:33 +0100
committerLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-17 22:02:33 +0100
commit0abec8156bd944aa883d544850ee1187219ba943 (patch)
tree55e222da361d176b0ba79611704b56e2d942a831 /scripts/bullet.gd
Initial commit
Diffstat (limited to 'scripts/bullet.gd')
-rw-r--r--scripts/bullet.gd17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/bullet.gd b/scripts/bullet.gd
new file mode 100644
index 0000000..93c119a
--- /dev/null
+++ b/scripts/bullet.gd
@@ -0,0 +1,17 @@
+extends Node3D
+
+var target: Vector3
+
+var bullet_speed = 100.0
+
+# Called when the node enters the scene tree for the first time.
+#func _ready() -> void:
+# pass # Replace with function body.
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta: float) -> void:
+ position = position.move_toward(target, bullet_speed * delta)
+
+ if (target - position).length_squared() <= 2:
+ queue_free()