I’ve looked for answers and found many, but none of them actually solve my problem.
The below is my code; I’m doing this on a server script because I want it to be replicated.
-- Set up our aim connection
runServ.Heartbeat:Connect(function()
local motor = plr.Character.Torso:FindFirstChild("aimMotor")
local aim = game.ReplicatedStorage.MiscRemoteEvents.getMouse:InvokeClient(plr)
local root = plr.Character.HumanoidRootPart
root.CFrame = CFrame.lookAt(root.CFrame.Position, Vector3.new(aim.X, root.CFrame.LookVector.Y, aim.Z))
end)
Below is what happens; note that this is connected such that it only runs when I am holding right click:
It works fine sometimes, but
- It looks choppy
- It starts bugging out when I look down a little
- I can’t actually move while aiming, because the CFrame constantly sets me to the same spot
I don’t know how to fix any of these, and I feel like a Motor6D approach would be better. The problem is, I don’t understand Motor6D scripting, and nothing I’ve looked up helps.
If you have a solution, be it Motor6D or anything else, do share and provide an explanation, especially if it’s Motor6D.