Better bullet traces and raycast for hitscan
This commit is contained in:
22
scenes/weapon/misc/bullet_trail_generic.gd
Normal file
22
scenes/weapon/misc/bullet_trail_generic.gd
Normal file
@ -0,0 +1,22 @@
|
||||
extends MeshInstance3D
|
||||
|
||||
func init(pos1, pos2):
|
||||
var draw_mesh := ImmediateMesh.new()
|
||||
mesh = draw_mesh
|
||||
draw_mesh.surface_begin(Mesh.PRIMITIVE_LINES, material_override)
|
||||
draw_mesh.surface_add_vertex(pos1)
|
||||
draw_mesh.surface_add_vertex(pos2)
|
||||
draw_mesh.surface_end()
|
||||
|
||||
# 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:
|
||||
pass
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
queue_free()
|
Reference in New Issue
Block a user