How do I shoot in the direction that the barrel attachment is facing??
function eFire(barrelAttachment)
if Tool.Parent:IsA("Backpack") then return end
local origin = barrelAttachment.WorldPosition
local direction = (origin - origin).Unit
if PIERCE_DEMO then
CastBehavior.CanPierceFunction = CanRayPierce
end
local simBullet = Caster:Fire(origin, direction, BULLET_SPEED, CastBehavior)
PlayFireSound()
end
^^^ This code doesn’t work. It’s what I tried to do, I just want to get the direction of the attachment! ^^^