Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make Character face mouse?

Asked by 6 years ago

I'm trying to make the character aim/face at the mouse. I did this but it just shot my character forward and barely rotated it with the mouse.

MouseAim = Mouse.Hit.p

UserBodyAim = game:GetService("RunService").RenderStepped:connect(function(dt)
            Character.HumanoidRootPart.CFrame = CFrame.new(Character.HumanoidRootPart.Position, Vector3.new(MouseAim.x,MouseAim.y,MouseAim.z))
            wait(10)
            UserBodyAim:disconnect()
        end)

1 answer

Log in to vote
0
Answered by 6 years ago

Try using the mouse.lookvector instead, I would put 0 on the y axis though due to the fact that it gets glitchy on that axis.

0
How would I even do this? DeathGunner132 120 — 6y
0
Replace mouseaim with mouse.lookvector cmgtotalyawesome 1418 — 6y
0
And the variable would be mouse.lookvector instead of mouse.hit.P cmgtotalyawesome 1418 — 6y
Ad

Answer this question