What I was trying to make was simply a script that rotated your player to face your mouse. This was the script I came up with (LocalScript)
local p = game.Players.LocalPlayer
repeat wait() until p.Character
local c = p.Character
local m = p:GetMouse()
local rs = game:GetService("RunService")
local tb = Instance.new("Part", Workspace.CurrentCamera)
local cc = Workspace.CurrentCamera
tb.CanCollide = false
tb.Transparency = 1
tb.Anchored = true
tb.FormFactor = "Custom"
tb.Size = Vector3.new(0.2,0.2,0.2)
tb.CFrame = c.Torso.CFrame *CFrame.new(0,15,5)
local tc = Instance.new("Part", Workspace.CurrentCamera)
tc.Transparency = 1
tc.CanCollide = false
tc.FormFactor = "Custom"
tc.Size = Vector3.new(0.2,0.2,0.2)
bpos = Instance.new("BodyPosition", tc)
bpos.maxForce = Vector3.new(math.huge, math.huge, math.huge)
bpos.position = tb.Position
rs.RenderStepped:connect(
function()
dist = (c.Torso.Position-m.Hit.p).magnitude
if dist > 8 then
c.Torso.CFrame = CFrame.new(c.Torso.Position, Vector3.new(m.Hit.p.x, c.Torso.Position.y, m.Hit.p.z))
end
cc.CoordinateFrame = CFrame.new(tc.Position, c.Torso.Position)
tb.CFrame = c.Torso.CFrame *CFrame.new(0,10,20)
bpos.position = tb.Position
end)
I found that when I used this, some controls were affected and the player went in strange directions rather than going in the direction that I would have liked. Is there anyway to get around this problem?

1 comment
Someone please help me on this ^~^