#How do i load an animation
1 messages · Page 1 of 1 (latest)
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
also i suggest looking into the roblox doc for animations:
sorry for the late response. But i should just put this local script in StarterCharacterScripts and that it or I need to do something else i didn't understand well.
Because i put the script in the StarterCharacterScripts but that didn't work
no
you do put it in starter character scripts
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
@sick dawn you there?
works?
The animationA i duplicate or i move in the startercharacterscript ?
look here
it goes in starterchar
Is not working, the model can be in anchor ?
i want the model to move not the player
k
sorry if I explained it badly
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
rbxassetid://16927477230
yeah try it
what it is i don't understand
I want this to move, are you sure this will work?
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
not working
no nothing
i put the humanoid in the model but that didn't work
put the animator in the humanoid
like this ?
yea
nothing happening but i have this error
you're loading the animID
local animTrack = animationController:LoadAnimation(animObject)
remove the line and paste this
i dont have the error but the model is not moving
rbxassetid://16927477230