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
487 B
GDScript
Raw Normal View History

2021-09-25 18:14:17 +02:00
extends Node3D
const SPEED = 250
2021-09-25 18:14:17 +02:00
# 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.FORWARD * SPEED / 60 * randf_range(0, 1)) # randomize starting point
$RayCast3D.target_position = - Vector3.FORWARD * SPEED / 30
2021-09-25 18:14:17 +02:00
func _process(delta):
if $RayCast3D.is_colliding():
queue_free()
else:
translate_object_local(Vector3.FORWARD * SPEED * delta)