Tilting a character's torso when walking

I want to achieve the effect of the character’s torso tilting towards the current direction of movement. I’ve searched for possible solutions, but to no avail. What type of methods would I need to use to go about doing this? Any help is appreciated.

Something like this is what I’d like to achieve:

3 Likes

Cannot see the video at all.
Did you upload it into the forum or save it somewhere else?

I uploaded it to streamable, then pasted the link to the video in my post. I’ll replace the video with one uploaded to the forum.

Here I wrote that real quick, it’s pretty close to what you want, but it’s not as smooth as the one shown on the gif above and it most likely has some bugs so yeah here’s the script you can play around with it a little.

local userInputService = game:GetService("UserInputService")
local players = game:GetService("Players")

local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humaindRootPart = character:WaitForChild("HumanoidRootPart")
local rootJoint = humaindRootPart:WaitForChild("RootJoint")

userInputService.InputBegan:Connect(function(input, gpe)
	if gpe then return end
	if input.KeyCode == Enum.KeyCode.D then
		rootJoint.C0 = rootJoint.C0 * CFrame.Angles(0, math.rad(-7), 0)
	end
	if input.KeyCode == Enum.KeyCode.A then
		rootJoint.C0 = rootJoint.C0 * CFrame.Angles(0, math.rad(7), 0)
	end
end)

userInputService.InputEnded:Connect(function(input, gpe)
	if gpe then return end
	if input.KeyCode == Enum.KeyCode.D then
		rootJoint.C0 = rootJoint.C0 * CFrame.Angles(0, math.rad(7), 0)
	end
	if input.KeyCode == Enum.KeyCode.A then
		rootJoint.C0 = rootJoint.C0 * CFrame.Angles(0, math.rad(-7), 0)
	end
end)
6 Likes