The harsh reality is that animations simply aren’t meant to be used this way. You can try and find some sort of bandaid fix, such as teleporting the player a frame before the animation ends, but you should just use physics to move the HumanoidRootPart.
Using some sort of physic constraint, and not the animation, to apply velocity to the HumanoidRootPart would be the most ideal and proper solution here.
I see your connecting remote events inside of CharacterAdded. This is a terrible idea, as everytime the player respawns, it will be connected again. It also doesn’t check if the player calling the remote. You need to either move it out of PlayerAdded, or check if the caller is the player you want, and you’ll have to disconnect old connections when unused.
I think a good approach would be, not changing the position of the character during the animation, the animation should keep the player in the origin position, and perform the movement of the character using a MoverConstraint or BodyMover, as you stated.
The animation of @DanielosthebestYTAlt , seems like a dash, then the dash should be done by scripts, and the animation should not change the LowerTorso position
Yup, I think you should edit the animation, and do not change the position of the player, just the sliding tackle animation at the origin point of the character. Then by scripts you should apply the “dash”, in that way the animation plays, the character actually does the dash in server.
Its a soccer game, would be better to handle that sliding tackle without depending on where is the character during the animation, otherwise, it will complicate other systems (like stealing the ball when theres is contact with it during the sliding)
I would love to, but I never made a dash system before, I can think on a couple of approaches on how to achieve it, but I dont have that experience, so any of those ideas would be the best one and I dont know which one is.
Its because the track.Length of the animation is not fully loaded, when it gets multiplied by 0.99 in that script from that solution, you should wait for the animation to be fully loaded into the animation track to get a value different than 0.
But that script just slows the animation speed, at the end of the animation. Could be useful if used with the getMarked approach I was saying, but, for a soccer game I hardly think animating the character to change its position would be a bad idea due to the other systems that should work.
I wonder if fighting games use a dash system based on the animations changing positions of the character
No, it will not. As I just told you, half of this topic is to stop the character from sliding back. If I do what you sent me, it will teleport, but it will also slide (i dont want that)
then try doing the other thing i said, don’t move the character with the animation and move it with body movers. Because you’ll most likely have to find a different method. as node said
they still work pretty good. games like parkour use it and that works just fine. An alternative would be aligned position/orientation but i can’t help with that since I’ve never really tried learning how they work