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

I wanted HumanoidRootPart faces at the location of my mouse but won't work? Please help!

Asked by 5 years ago

Ofcourse, local root = game.Players.LocalPlayer.Character.HumanoidRootPart and root.CFrame = CFrame.new(root.Position, mousehit.p * Vector3.new(1,0,1) + root.Position * Vector3.new(0, 1, 0)) wont work for me during KeyDown events, but when my friend uses the root thingy, it faces at the location of the mouse but whenever I use the root thingy, my HumanoidRootPart faces at the opposite side of the mouse, please help?

0
Could you format it better please, I can't read it that well. bluestreakejjp 41 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

There is a built in function which works with the mouse called a 'lookVector' You could get the HumanoidRootPart to face your mouses lookVector.

So you could do something like

local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()

while true do 
wait()
plr.Character:WaitForChild("HumanoidRootPart").CFrame = Mouse.lookVector()

Not 100% that will do the job but its more as an example than anything.

Ad

Answer this question