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

How do I change the running animation when i am sprinting?

Asked by
Xorpoz 0
4 years ago
01local speed = 60
02local norm_spd = 40
03local ke_y = Enum.KeyCode.LeftShift
04local fovMax = { FieldOfView = 70 + (speed/5) }
05local fovMin = { FieldOfView = 70 }
06local thing = game.Workspace.CurrentCamera
07local tween = game.TweenService:Create(thing, TweenInfo.new(0.4, Enum.EasingStyle.Sine), fovMax)
08local tween2 = game.TweenService:Create(thing, TweenInfo.new(0.4, Enum.EasingStyle.Sine), fovMin)
09local UIS = game:GetService("UserInputService")
10 
11UIS.InputBegan:Connect(function(input, processed)
12   if processed then return end
13   if input.UserInputType == Enum.UserInputType.Keyboard then
14 
15        if input.KeyCode == ke_y then
View all 27 lines...

This is my code, how do I change the animation from walking (the normal animation) to my custom made running animation only when I am sprinting?

1 answer

Log in to vote
0
Answered by
Desmondo1 121
4 years ago

Put an animation into wherever you want but im gonna use ServerStorage and name the animation whatever you want but im just gonna call it animation and then do

local ServerStorage = game:GetService("ServerStorage") -- References ServerStorage

local Player = game.Players.LocalPlayer -- References the LocalPlayer

local Humanoid = Player.Character:WaitForChild("Humanoid") -- References the players humanoid

local Animation = Humanoid:LoadAnimation(ServerStorage.Animation) Animation.Play()

Now you're gonna have to make your own animation but just go into the plugins menu, select the rig builder, place down a r15 or r6 dummy, and then click on the animation editer, select the dummy.

Then you can start animating, just make a running animation (tip: You can go into the Home menu to get the moving and rotating options)

Once you're done, click the three dots on the top of the animation editer gui thing, then select export, Do the name and description of the animation, then upload it. Then go to the page where you uploaded it, copy the link. And paste the link into the animation (The actual animation, not in the code) Paste it in the AnimationId property.

Also, if this doesn't help, you can just watch a tutorial, there are lots of tutorial on animation.

Ad

Answer this question