Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make a player face where the mouse is pointing?

It faces in the same direction every time regardless of where I click.

local player = game.Players.LocalPlayer

script.Parent.Selected:connect(function(mouse)

mouse.Button1Down:connect(function()


b = Instance.new("BodyVelocity")
b.maxForce = Vector3.new(3000,5000,3000)
b.Parent = player.Character.Torso
b.velocity = Vector3.new(0,0,0)

**gyro = Instance.new("BodyGyro")
gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)**

**while wait() do**

b.velocity = mouse.Hit.p

**gyro.cframe = mouse.Hit**

**end**
end)
mouse.Button1Up:connect(function()

b:Destroy()

gyro:Destroy()
end)
end)
script.Parent.Deselected:connect(function()

b:Destroy()

end)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.