In a parkour game I am playing a vaulting animation, but the animation of course just plays on the same position, and to make character actually move forward, I do this.
vaultAnim:Play()
for i=1,10 do
task.wait()
root.CFrame += root.CFrame.LookVector* 1.001
end
It works, but the character moves forward too fast, no matter how much I change the i, or * 1.001 values.
How can I control the speed with which it moves?
I dont want to use tweenService as creating tweenservice everytime player vaults would be too heavy on performance.
Alternatively you can tell me how else can I move the character along with animation. Thank you in advance!
vaultAnim:Play()
for i=1,10 do
task.wait(0.1)
root.CFrame += root.CFrame.LookVector* 1.001
end
Try putting some value within “task.wait()” to wait a little more before the player moves forward.
0.03 seconds wait is the default so try putting something higher like 0.1. If it seems too slow try 0.07 or something.
You could try using BodyVelocity but it would just push the player in a direction. I’m not sure if that would work out for you.
And if it matches the speed and you want to stop it from being glitchy/laggy you could use lerp:
Like so: