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

Having trouble making Movement Cycle Animation script,Help?

Asked by 6 years ago
Edited 6 years ago

For some reason I get the output error, ** "Play is not a member of Animation" Help?!**

This localscript works from StarterPack

local WalkIDanimation = Instance.new("Animation")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local RunSpeed = 132 -- the speed they run
local WalkSpeed = 16 -- the speed they walk
local JogSpeed = 59

for i = 1,math.huge do
if Character.Humanoid.WalkSpeed > RunSpeed then
    Character.Humanoid:LoadAnimation(WalkIDanimation)
    WalkIDanimation.AnimationId = "http://www.roblox.com/asset/?id=843278004"
    WalkIDanimation:Play()
elseif Character.Humanoid.WalkSpeed > JogSpeed then
WalkIDanimation.AnimationId = "http://www.roblox.com/asset/?id=865162365"
    WalkIDanimation:Play()
elseif Character.Humanoid.WalkSpeed < RunSpeed then
WalkIDanimation.AnimationId = "http://www.roblox.com/asset/?id=865162365"
    WalkIDanimation:Play()


wait()
end
end

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

Animations are not meant to be played, they are meant to be loaded by a humanoid, which gives you a track to play.

Also you should not set AnimationId inside the loop (more than once).

The way this is set up, tracks would never really play anyway since you start a new one every frame. You probably want to connect Humanoid.Running to a function that smoothly, safely plays certain tracks.

There are many other issues. This is clearly too broken to fix myself. You need to understand animations first.

http://wiki.roblox.com/index.php?title=Animations

http://wiki.roblox.com/index.php?title=Changing_default_character_animations

Ad

Answer this question