This repository has been archived on 2022-01-09. You can view files and clone it, but cannot push or open issues/pull-requests.
liblast/Game/Assets/Effects/BulletTracer.gd

20 lines
468 B
GDScript

extends Node3D
const SPEED = 200
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
translate_object_local(Vector3.UP * SPEED / 60 * randf_range(0, 1)) # randomize starting point
$RayCast3D.target_position = Vector3.UP * SPEED / 60
func _process(delta):
if $RayCast3D.is_colliding():
queue_free()
else:
translate_object_local(Vector3.UP * SPEED * delta)