wait(2) local player = game.Players.LocalPlayer local Mouse = player:GetMouse() local humanoid = player.Character.Humanoid --Humanoid local s = humanoid:LoadAnimation(game.StarterPack.PwrSlide.Animation) Mouse.KeyDown:connect(function(key) if key:lower() == "c" and humanoid then s:Play() humanoid.WalkSpeed = 29 wait(1) humanoid.WalkSpeed = 14 wait(1) humanoid.WalkSpeed = 1 s:Stop() humanoid.WalkSpeed = 16 wait(5) end end)
Anyone ever play that new Star Wars game on roblox or NRPG, and when you double tap W, S, A, or D, the player does an animation, but it moves them side-ways or forward? Like, if you double-tap W (On NRPG) you do a front flip, moving you forward. Not just a front flip in place. What I have here is a Slide animation, it speeds up the walkspeed of a player but I don't like it. I was wondering how would I make the player move forward "x" amount of studs (Or whatever). I assume Vector3 is needed in this, right?
NO I do not want people to double-tap C. Just once, and it makes the slide animation while moving the player forward automatically.
Your animation would be one where the actual animation just puts the player in the slide position, not actually moving them. Then it would be a simple case of smoothly moving the character forward, using the torso or something.
For example (this may not be the most efficient way to do this):
function slide() slideAnim:Play() for i = 1,200 do -- 2 second slide animation char.Torso.CFrame = char.Torso.CFrame + Vector3.new(0.025,0,0) -- this would move the character 5 studs forward in total wait(0.01) end end
If you have any other problems, PM me on ROBLOX (username is EmeraldSlash).
~TDP