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/Assets/Effects/BulletTracer.gd

24 lines
537 B
GDScript
Raw Normal View History

2020-09-18 01:09:54 +02:00
extends Spatial
2020-09-18 01:24:54 +02:00
var first = true
var velocity = 4
2020-09-18 01:09:54 +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():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
2020-09-18 01:24:54 +02:00
if first:
translate_object_local(Vector3(0,rand_range(0, velocity),0))
first = false
else:
translate_object_local(Vector3(0,velocity,0))
2020-09-18 01:09:54 +02:00
func _on_Raycast_body_entered(body):
queue_free()