#bullet
extends Area3D
var muzzle_velocity = 25
var g = Vector3.FORWARD
var velocity = Vector3.ZERO
func _physics_process(delta):
velocity += Vector3.FORWARD
transform.origin += velocity * delta
#gun
var b = get_node("../Bullet").duplicate()
var node = Node3D.new()
node.position = position + Vector3(0,0.5,0)
node.rotation = $Pivot.rotation + rotation
node.add_child(b)
get_node("../").add_child(node)
b.position = Vector3(0,0,0)
b.velocity = -b.transform.basis.z * b.muzzle_velocity