With a slightly angled birds-eye view camera of my character, whenever I make the character look at the mouse, a slight force tends to slow down my characters movement for a good couple of seconds.
This can be seen visually here:
http://www.roblox.com/games/276570398/circlesss
I've tried to reason out the issue but nothing comes to mind.
First off, I am passing in two arguments to CFrame. One is the HumanoidRootPart Position and the other is the Mouses 'hit' location
This causes the HumanoidRootPart to keep its location but turn to look at where the mouse is hitting the base.
Also, yes, the camera is slightly angled. The reason I mention is because when you keep a camera directly on top of the character, it cannot tell right from left to front to back.
1.) A mysterious force slows down the character at times
2.) Sometimes when I move the mouse, the character starts walking in a completely different direction
3.) Speed while turning gets slowed down for some odd reason
If there is a syntax error, sorry. I removed a lot of lines that didn't deal with the HumanoidRootPart.
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false) game:GetService("UserInputService").MouseIconEnabled = false local plr = game.Players.LocalPlayer local chr = plr.Character or plr.CharacterAdded:wait() local mouse = plr:GetMouse() local root = chr:WaitForChild("HumanoidRootPart") local leftLeg = chr:WaitForChild("Left Leg") local rightLeg = chr:WaitForChild("Right Leg") local hum = chr:FindFirstChild("Humanoid") hum:EquipTool(plr.Backpack:WaitForChild("RealRifle")) -- local camera = workspace.CurrentCamera camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable; camera.CameraSubject = hum; local falling = false; local mouse = plr:GetMouse() mouse.TargetFilter = workspace.Map hum.Changed:connect(function() hum.Jump = false; end) hum.FreeFalling:connect(function(plrFalling) falling = plrFalling end) hum.Died:connect(function() chr = plr.CharacterAdded:wait() root = chr:WaitForChild("HumanoidRootPart") leftLeg = chr:WaitForChild("Left Leg") rightLeg = chr:WaitForChild("Right Leg") hum = chr:FindFirstChild("Humanoid") end) game:GetService("RunService").RenderStepped:connect(function() root.CFrame = CFrame.new(root.Position, Vector3.new(mouse.Hit.p.X, root.Position.Y, mouse.Hit.p.Z)) --This is the area where I am 'rotating' the HumanoidRootPart camera.CoordinateFrame = CFrame.new(CFrame.new(root.Position + Vector3.new(-20,45,0)).p,root.Position) end)
I'm just going to try to improve your player follows mouse script.
mouse.Move:connect(function() root.CFrame = CFrame.new(root.Position, Vector3.new(mouse.Hit.p.X, root.Position.Y, mouse.Hit.p.Z)) --This is the area where I am 'rotating' the HumanoidRootPart camera.CoordinateFrame = CFrame.new(CFrame.new(root.Position + Vector3.new(-20,45,0)).p,root.Position) end)
I used the mouse move event to stop this from running on RenderStepped. I'm not sure if this will fix the code, but it will improve it lagwise.