Same Animation Ends at different locations?

Hey developers. I have an animation that when played in the animation editor, works flawlessly and goes to the correct positions it needs to go. You see this animation has the player walking up to a railing. The only issue, is why I apply the ‘player’ part of the script. Character’s either overshoots, undershoots, or sometimes is perfect on its own. (This issue isn’t randomized, and the same character has the same result. In other words, if the character undershoots, it always undershoots by the same amount). Can anyone help?

This is my script:


local function CloneMe(char) 
	char.Archivable = true
	local clone = char:Clone()
	char.Archivable = false
	return clone
end


	local char = CloneMe(game.Players.LocalPlayer.Character)
	char.Parent = game.Workspace
	char:PivotTo(game.ReplicatedStorage.Animations.Rig:GetPivot() * CFrame.new(Vector3.new(0, 4, 0)))
	local ani : Animator = char.Humanoid.Animator
	local First = ani:LoadAnimation(game.ReplicatedStorage.Animations.EachOne.WalkTo)
	First:Play()

And these are the results of 2 different characters.

Undershooting:

Overshooting:

Any help is much appreciated!

I’m bumping this post because I really need help as this animation will be also connected with a camera. If there is no solution. Is there atleast a way to caculate this offset (Ex: if it overshoots, we start the animation 2 studs back to correct this). I don’t do too much rig/Animation scripting as I would like too. Any help again is much appreciated!

I tried some more things but couldn’t figure out why its different for people.

1 Like

Have you tried setting the Humanoid root part instead of the whole model pivot? I am not sure but it is possible that pivot is a little bit different from character to character, since it depends on all the parts/meshes in the character, which are different from player to player.

1 Like

I have tried it and had the same results:

char.HumanoidRootPart:PivotTo(game.ReplicatedStorage.Animations.Rig.HumanoidRootPart:GetPivot() * CFrame.new(Vector3.new(0, 4, 0)))

‘game.ReplicatedStorage.Animations.Rig’ is the position you need to be for the animation according the the animation editer if that helps at all.

That is very weird, I’ve never encountered something like this and I’ve worked a ton with animations in the past. The only thing that comes to my mind is that you scrap the position data in the animation and instead use animation event to add velocity/make the humanoid walk towards the railing.

1 Like

I’m so confused haha. The only position line is this line,
char:PivotTo(game.ReplicatedStorage.Animations.Rig:GetPivot() * CFrame.new(Vector3.new(0, 4, 0)))
which is connected to the dummy that was used in the animation editor that worked perfectly. Its annoying me that it won’t work

Bumping this because my issue hasn’t been solved yet :melting_face: I’m willing to try anything at this point

I even changed my script a bit. Still having this issue.

local char = game.ReplicatedStorage.Animations.Rig:Clone()
	char.Parent = game.Workspace
	local humdescript = game.Players:GetHumanoidDescriptionFromUserId(game.Players.LocalPlayer.UserId)
	task.wait(2)
	char.Humanoid:ApplyDescription(humdescript)