Hello, I’m having this issue with making a flashlight point to a players mouse position. I’ve attached a video on the behaviour that happens.
For some reason the flashlight rotates on one axes but also seems to rotate on another, and I’ve noticed that the direction it’s pointing in is offset by 90 degrees, which I’m also not sure how to fix.
What I really want for it to do is to rotate on all axes towards the mouse. This is the relevant code I’m using to update the CFrame
:
RunService.Heartbeat:Connect(function()
if equipped and hand then
script.Parent.CFrame = CFrame.lookAt(hand.Position, mouse.Hit.p, Vector3.new(0, 1, 0))
end
end)