I was making my first gun but the bullet does not start at the tip of the barrel. I was trying to make it look like Big PaintBall where you can clearly see where it starts but I do not know how.
function Look_At(TiP, Position)
local face_direction = (Tip.CFrame.p - Position).unit
return CFrame.lookAt(Tip.CFrame.p - Vector3.new(0,0,2), Position)
newBullet.CFrame = Look_At(Tip.CFrame.p, Laser.Position)
local speed = (Laser.Position - Tip.CFrame.p).Unit * 600
newBullet.Velocity = speed
end
the first parameter of lookat is the position, correct however your position is where you mess up. I don’t know what this “laser.Position” specifically is but if i suspect it is the thing you are moving then this will be a recursive loop. Anyways My point is you should replace Laser.Position with a vector generated from the head and tail of the vector you used to generate the ray
basically we get the orientation the cframe should be with the look at thing then we combine those matricies together *= is basically newBullet.CFrame = newBullet.CFrame * Look_At(params)