I have a Tool class item. It contains a Handle and I don’t understand how to set up tool.Grip so that the Handle points in the direction of the mouse position while remaining in the hand.
I want to make a mechanic similar to a lezar from a hand.
This should work.
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Move:Connect(function(position)
local newCF = CFrame.lookAt(tool.Handle.CFrame, position)
tool.Handle.CFrame = newCF
)
If the wrong face is pointing at the position, you can try doing this with local newCF:
local newCF = CFrame.lookAt(tool.Handle.CFrame, position) * CFrame.Angles = (math.rad(0), math.rad(0), math.rad(0))
Mess with the 0’s in the math.rads until it is rotated the right way.
1 Like
