I’m making a simple flashlight system, and I’m trying to get a part to look towards my mouse’s position. The problem is that it always seems to be inverted, and prioritizes looking at a direction where there is absolutely nothing.
I’ve tried so many different things and have been looking for help in the Discord but still haven’t figured out a solution. Any help would be great, thanks.
mouseconnection = mouse.Move:Connect(function()
if leftArmPart:FindFirstChild("Flashlight") then
local flashlight = leftArmPart:FindFirstChild("Flashlight")
flashlight.Beam.Weld.C0 = CFrame.lookAt(flashlight.Beam.Weld.C0.Position, mouse.Hit.LookVector)
else return end
end)
end
(The spheres in the video are there for visualization so you can see where my mouse is detecting at, the screenshot also shows the hierarchy of the “Beam” part that I am trying to rotate). Additionally, I have a blue selection face set towards the front of the part.