I’m trying to make it so that when you sit on this VehicleSeat, the player enters this animation:
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:
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):
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!
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.
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: