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

Roblox R15 torso CFrame trouble glitches out and forces player to jump?

Asked by 6 years ago
Edited 6 years ago
local Mouse = game.Players.LocalPlayer:GetMouse()
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer

local torso = Player.Character.HumanoidRootPart
print(torso)

UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
print(Player.CameraMode)
UserInputService.InputChanged:connect(function(inputObject)
    print(Player.CameraMode.Value)
    if inputObject.UserInputType == Enum.UserInputType.MouseMovement and Player.CameraMode.Value == 1 then
        local x,y,z = torso.CFrame:toEulerAnglesXYZ()

        torso.CFrame = CFrame.Angles(math.rad(x+inputObject.Delta.y),y,z)

    end
end)

Instead of rotating the torso it just bugs the player out and forces them to jump there is something about cframe I'm not getting thanks for your help.

0
Try RootPart TheePBHST 154 — 6y
0
`torso.CFrame = torso.CFrame * CFrame.Angles...`? TheeDeathCaster 2368 — 6y
0
use HumanoidRootPart WindowMall 54 — 6y
0
didn't change still get flung around everywhere TheGreatSailor 20 — 6y

Answer this question