2024-08-03 17:33:20 +02:00
|
|
|
extends RigidBody3D
|
|
|
|
|
|
|
|
var life_span = 0
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
set_contact_monitor(true)
|
|
|
|
set_max_contacts_reported(5)
|
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
func _process(delta):
|
|
|
|
life_span += delta
|
|
|
|
if life_span > 5:
|
|
|
|
print("removed shot")
|
|
|
|
queue_free()
|
|
|
|
|
|
|
|
func init_round(start:Node3D, aim_vec:Vector3):
|
|
|
|
position = start.global_position
|
|
|
|
transform.basis = start.global_transform.basis
|
|
|
|
#print(start.target_position)
|
2024-08-07 00:12:56 +02:00
|
|
|
set_linear_velocity(aim_vec.normalized() * 890.0)
|