You should split the rotation between the neck motor6d and the waist motor6d
try this: (client script)
local tiltAtEvent = game.ReplicatedStorage:FindFirstChild("tiltAt")
local camera = workspace.CurrentCamera
local function onUpdate(dt)
tiltAtEvent:FireServer(math.asin(camera.CFrame.LookVector.y));
end
game:GetService("RunService").RenderStepped:Connect(onUpdate)
and then: (server script)
local tiltAtEvent = game.ReplicatedStorage:FindFirstChild("tiltAt")
local neckC0 = CFrame.new(0, 0.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local waistC0 = CFrame.new(0, 0.2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
tiltAt.OnServerEvent:Connect(function(player, theta)
local neck = player.Character.Head.Neck;
local waist = player.Character.UpperTorso.Waist;
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(theta*0.5, 0, 0);
waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(theta*0.5, 0, 0);
end)
make sure to make a remote event in replicated storage called tiltAt
8 comments
What exactly is pp?
Pp refers to the characters primary root part
would it be the Humanoid.RootPart? Just to clarify
Yes.
I tried it, I put the code in a local script in StartCharacterScripts, but it doesn't work. i replaced p as position and made pp as a variable to humanoid.rootpart. Nothing happend.
Try publishing nothing seems wrong with this code
Make sure there is a bodygyro.
I edited tell me wether it works.