local char=game:GetService'Players'.LocalPlayer
char=char.Character or char.CharacterAdded:Wait()
game:GetService'RunService'.Stepped:Connect(function(dt)
local upper=char.UpperTorso
local waist=upper.Waist
local lower=char.LowerTorso
local hrp=char.HumanoidRootPart
local lowerloc=hrp.CFrame:inverse()*lower.CFrame
waist.Transform=(waist.C0-waist.C0.p):inverse()*(lowerloc-lowerloc.p):inverse()*(waist.C1-waist.C1.p)
print((hrp.CFrame:inverse()*upper.CFrame):ToEulerAnglesXYZ())
end)
I would like it to use the existing motor6ds because I am overlaying extra (a second and sometimes a third) Roblox animations on top, I am just using this to remove the first animation’s UpperTorso transformation caused by animating the LowerTorso
also, even though it looks like its just calculation errors, I’m experiencing jittering
here is video if it helps
I think the best way to solve this would be implementing your own animations for your character, since the real reason there would be any offset between the torso and the HumanoidRootPart would be from the (first) animation rotating the torso the tiniest bit.
The built-in Animate script that comes with the character contains StringValues as children which let you easily change AnimationId’s on the fly, and you can simply copy and paste this script into StarterCharacterScripts in StarterPlayer, with the new AnimationId’s applied.
We are using custom movement animations, but the problem is that when you shift the lowertorso, the uppertorso shifts too (its an intrinsic property of roblox animations)
So just updating the movement animations will not work for me (movement animations without the lowertorso moving look a little strange), that is why I am trying to negate the transformations applied
So Stepped is right before physics while renderstepped (and bindtorenderstep) is right before rendering
New property: Motor6D.Transform says to only use Stepped when dealing with the Transform property, so I do not believe you can use something else here (I initially was doing BindToRenderStep but it was not working)
As for the difference between BindToRenderStep and RenderStepped:
Testing with this code:
so RenderStepped fires immediately after all of BindToRenderStep priorities-interestingly, priorities a little more than 2^30 go before the lowest priorities
My guess is that RenderStepped was introduced before BindToRenderStep, and should be deprecated since you have more control with BindToRenderStep (you can set the priorities-which is quite necessary to avoid hacky code[although I would argue this in it of itself is hacky])