How do you tilt a players torso / upperbody only? (R6)

Below is an example of what I want to achieve. But let me go into detail anyways, in case you don’t understand.

  1. When the player holds A, or D their torso will tilt in the direction of where they’re going
  2. Only their torso, arms, and head will tilt. Their legs will stay aligned with the character’s Root.

Here’s an example of what I’m trying to achieve:

Use a script to make the legs (either separated or in the same script) go in the opposite direction the Root tilt. If the Root were to tilt 15 degrees, the legs would tilt -15 degrees, making them still planted on the ground while walking.

This is assuming you already have the Root tilt script.

1 Like
local Run = game:GetService("RunService")
local UserInput = game:GetService("UserInputService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Torso = Character:WaitForChild("Torso")

UserInput.InputBegan:Connect(function(Input1, Processed)
	if Processed then
		return
	end
	
	if Input1.KeyCode == Enum.KeyCode.A or Input1.KeyCode == Enum.KeyCode.D then
		local Connection1
		Connection1 = Run.RenderStepped:Connect(function()
			if UserInput:IsKeyDown(Enum.KeyCode.A) then
				Torso.CFrame *= CFrame.Angles(math.rad(Torso.CFrame.Rotation.X), math.rad(Torso.CFrame.Rotation.Y), math.rad(Torso.CFrame.Rotation.Z + 5))
			elseif UserInput:IsKeyDown(Enum.KeyCode.D) then
				Torso.CFrame *= CFrame.Angles(math.rad(Torso.CFrame.Rotation.X), math.rad(Torso.CFrame.Rotation.Y), math.rad(Torso.CFrame.Rotation.Z - 5))
			else
				Connection1:Disconnect()
			end
		end)
		
		local Connection2
		Connection2 = UserInput.InputEnded:Connect(function(Input2, Processed)
			if Processed then Connection2:Disconnect() return end
			
			if Input2.KeyCode == Input1.KeyCode then
				Torso.CFrame *= CFrame.Angles(0, 0, 0)
				Connection2:Disconnect()
			end
		end)
	end
end)

Just wrote this script, it’s working fairly well.

Here’s a demonstration:
https://gyazo.com/32642f29d0ce59af3c41b5c06d95395e