I would like to have a beam go in the lookvector of the part and stop exactly when the ray hits something.
However this seems to happen. It’s close but unfortunately it seems it will offset depending on the rotation. It will change the amount of offset depending on the rotation, however whats strange is that my raycast works great, however the beam thats meant to replicate the raycast is offset. So all it is is a visual bug, however im not very sure why.
I have tried to use a few different ways of calculating it however it doesnt seem to work anymore.
Heres the part of code I think is wrong with also the raycasting
local ray = Ray.new(caster.Position, caster.CFrame.LookVector * 2000)
local hitPart, hitPosition = workspace:FindPartOnRay(ray)
local Distance = (caster.Position - hitPart.Position).Magnitude
caster.BeamEndAttachment.Position = (caster.CFrame.lookVector)*Distance
would be great if i could find a solution, as I really enjoy working with the Beam particle, and i personally think its more efficient than a block.