Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts/bullet.gd
diff options
context:
space:
mode:
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()