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.
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!
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.
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.
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