I’m trying to make a gun and for some reason the Raycast direction is above the mouse.
I have no idea whats going on. I’ve tried messing with values and other stuff but no avail.
code:
local Mouse = List.Mouse
local Origin = List.Origin
local Direction = (Mouse - Origin).Unit
local Distance = (Mouse - Origin).Magnitude
if Distance > List.MaxDist then
Distance = List.MaxDist
end
local Raycast = Ray.new(Origin, Direction * Distance)
local marker = List.Projectile:Clone()
marker.Parent = workspace.Debris
marker.Position = Direction * Distance