Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make this rolling animation so it projects you forward?

Asked by 6 years ago

ive made a rolling animation but i dont know how to make it so it projects you (moves you) forward depending on which way your character is facing.

Code:

repeat wait() until game.Players.LocalPlayer.Character

local Player = game.Players.LocalPlayer
local Char = Player.Character
local UIS = game:GetService('UserInputService')
local Played = false


function TestAnim(input)
   if input.KeyCode == Enum.KeyCode.R and Played == false then
  Played = true
  local Anim = Instance.new('Animation')
  Anim.AnimationId = 'rbxassetid://12345678'-- fake animation id
  local PlayAnim = Char.Humanoid:LoadAnimation(Anim)
  PlayAnim:Play()
  wait(3)
  Played=false
   end
end


UIS.InputBegan:connect(TestAnim)

this script here does a rolling animation but stays at the same place, however i dont know how to make it so it plays the animation and moves you forward. I hope you understand what i mean.

0
Ah, I see you are trying to make a roll-move like the one in the egg hunt. That's pretty cool! Will help you out if any idea comes to my mind. Le_Teapots 913 — 6y
0
yea im trying to make it like the roll in egg hunt LordOfWatermelons 27 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Try using the Vector3, when the animation plays use Vector3 to move the player forward.

The following example would cause 'Player1' (in Workspace) to walk forward, towards where their camera is pointing, wait five seconds, and then stop the player.

Workspace.Player1.Humanoid:Move(Vector3.new(0, 1, 0), true)
wait(5)
Workspace.Player1.Humanoid:Move(Vector3.new(0, 0, 0), true)

I am not sure if this will work, didnt test it. But try it, hope it works and if you have any problems just ask.

If I helped and it worked please mark it as an answered question. :) Good Luck.

Ad

Answer this question