Custom seating animation issues

I’m trying to make it so that when you sit on this VehicleSeat, the player enters this animation:
image

It works perfectly fine for a normally sized humanoid. However, when I shrink the humanoid in half (it’s for a baby sized character), the person is hovering:

image

But the default sitting animation still positions the baby-sized-character correctly in a non-floating position (so it’s not a problem with the vehicle seat itself):
image

I decided to compare the default sitting animation to my custom animation:


Note how the buttocks is in the same exact position (in relation to the HumanoidRootPart) as the left foot. However, the buttocks sits perfectly normally on the scooter, but the left foot is hovering a stud in the air.

I have no idea why this is happening, and any insight would be greatly appreciated. If there are any Roblox engineers/interns here who are able to read how the Roblox sitting logic works, that would also be really helpful. Thanks!

3 Likes

It looks like what you have is a translation of the joint between the HumanoidRootPart and the LowerTorso (the Root joint) built into the animation. When you scale the character this translation is not scaled so it results in a positioning issue for the scaled character. I think the default sitting animation must not use any translation or much less translation so the same issue doesn’t appear.

What I would do to fix this is completely remove the translation from the animation and instead edit the Transform property directly while applying the scaling factor to the translation you are applying.

You’d want to do something like this while the player is seated.

local PlayersService = game:GetService("Players")
local RunService = game:GetService("RunService")

local localPlayer = PlayersService.LocalPlayer
local character = localPlayer.Character

RunService.Stepped:connect(function()
	character.LowerTorso.Root.Transform = character.LowerTorso.Root.Transform + Vector3.new(0, 10, 0)
end)

You would need to run this code for all the characters using a scooter on all clients but it seems pretty doable.

Another option to fix this if you only allow for scaling in a few sizes might actually be to create different versions of the animation for each size.

4 Likes

Thank you so much for such a rapid response! I’ll try it out and post the results here :slight_smile:

I tried removing the translation between the HumanoidRootPart and the LowerTorso; and then translating the physical seat instead

No animation:

My animation (note how the lower torso is in the same position):

However, the baby hovering still exists.

Baby (note how the VehicleSeat has been moved up a stud):
image

Adult:
image

Do you know if there is something wrong with my approach? Or if there is anything else that could be causing the translation?

Seems simple, but have you tried to make a separate animation that is below the white linings in the animation editor?

Unfortunately moving the animation below the white lines simply moves the humanoid down too low. No matter where we shifted the animation, it became too high or low for either the baby or parent.

After much experimentation, @TheGamer101 and I were able to come up with this working solution. I’ll post it here just in case anyone else stumbles upon this problem in the future:

image

Baby:
image

Parent:
image

6 Likes