#How do i load an animation

1 messages · Page 1 of 1 (latest)

tender abyss
#

hey

#

it should be a LocalScript in StarterCharacterScripts with your assets too

#

here:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local animator = humanoid:WaitForChild("Animator")
local animObject = script.Parent.AnimationA
local animTrack = animator:LoadAnimation(animObject)


task.wait(8)
animTrack:Play()```
#

this is a LocalScript in StarterCharacterScripts

#

the problem with your script was that you were loading the animation controller and not referencing the animation controller to the player

#

you dont need an animation controller because the Humanoid already has a built in Animator

#

add the assets to the corresponding hierachy in StarterCharacterScripts then test it to see if it works

#

@sick dawn

sick dawn
#

Because i put the script in the StarterCharacterScripts but that didn't work

tender abyss
#

you do put it in starter character scripts

tender abyss
# sick dawn sorry for the late response. But i should just put this local script in StarterC...

i was mistaken. here is the actual script. i forgot to add waitforchild

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local animator = humanoid:WaitForChild("Animator")
local animObject = script.Parent:WaitForChild("AnimationA")
local animTrack = animator:LoadAnimation(animObject)

animTrack.Looped = true
animTrack:Play()```
#

it is a local script in startercharacterscripts. the hierarchy should look like this

tender abyss
#

@sick dawn you there?

sick dawn
#

yes

#

i test

tender abyss
#

works?

sick dawn
#

The animationA i duplicate or i move in the startercharacterscript ?

tender abyss
#

it goes in starterchar

sick dawn
#

Is not working, the model can be in anchor ?

tender abyss
#

what model

#

no it should be the player

#

copy the script

sick dawn
tender abyss
sick dawn
#

sorry if I explained it badly

tender abyss
#

nah it's fine

#

1 minute

tender abyss
#
local Rig = workspace.Rig
local animator = Rig.Humanoid.Animator
local animation = Rig.AnimationA
local animTrack = animator:LoadAnimation(animation)


animTrack.Looped = true
animTrack:Play()
#

script is inside the rig

#

AnimationA can have any id

#

@sick dawn

sick dawn
#

rbxassetid://16927477230

tender abyss
#

yeah try it

sick dawn
tender abyss
#

create a rig

#

then put the script and animationa inside

sick dawn
#

I want this to move, are you sure this will work?

tender abyss
#

no, you need a humanoid and animator

#

save the model to a file and send it to me

sick dawn
#

already here

tender abyss
# sick dawn already here

try this script:

local animationController = script.Parent.AnimationController
local animObject = script.Parent.AnimationA
local animId = "rbxassetid://16927477230"
local animTrack = animationController:LoadAnimation(animObject)


animTrack:Play()```
#

copy and paste it into your script

sick dawn
#

not working

tender abyss
#

does it give an error?

#

@sick dawn

sick dawn
#

no nothing

tender abyss
#

add a Humanoid

#

@sick dawn

sick dawn
#

i put the humanoid in the model but that didn't work

tender abyss
#

put the animator in the humanoid

sick dawn
#

like this ?

tender abyss
#

yea

sick dawn
#

nothing happening but i have this error

tender abyss
#

local animTrack = animationController:LoadAnimation(animObject)

#

remove the line and paste this

sick dawn
#

i dont have the error but the model is not moving

tender abyss