#I can't figure out how to play an animation.

94 messages · Page 1 of 1 (latest)

low badge
#

your going in the player

#

there is a property of player

#

that is.Character

#

so

#
game.Players.LocalPlayer.Character
#

using character gives you acess to the actual player character

onyx coral
#

oh. my god. so I literally just needed to add a .Character.

low badge
#

and the humanoid is in character

#

yea

onyx coral
#

well, thank you for the help! it's working now.

#

I can't believe I was that close to doing it on my own.

low badge
#

🎉 yay

pliant island
#

@low badge hey sorry for ping but
do you know how to anim model?

low badge
#

what

#

what does that mean

#

what do you mean

barren fulcrum
#

Animate model?

pliant island
#

so i already have animation for model but in game it doesnt work only my animation character work
anyone know how to fix this?

low badge
#

how are the wings on the character? are they inside the player model

pliant island
#

no i use script for it

low badge
#

honestly idk how to animate assecories

pliant island
#

ea

barren fulcrum
#

When In doubt go to YouTubeagony

onyx coral
# low badge 🎉 yay

yo rq mind helping me with something else..? I can't figure out how to stop the animation now.

here's the code, too

low badge
#

anim:Stop()

#

if you have the AnimationTrack and not the Animation

onyx coral
#

that's what I've been trying to use already

low badge
#

so store the animation by already loading it

onyx coral
#

I've also tried putting it under the else

low badge
#

lemme write rq

#
local humanoid:Humanoid = game.Players.LocalPlayer
local animiation = humanoid:loadAnimation()

script.Parent.MouseButton1Click:Connect(function()
if animiation.IsPlaying == false then
    animiation:Play()
    else
    animiation:Stop()
end
end)

#

so you load the animation already

#

and you can check if the animation is playing

onyx coral
#

I'm struggling to understand. what am I doing wrong here?

undone mapleBOT
#

studio** You are now Level 1! **studio

low badge
#

we get the humanoid outside the function

#

we load the animation

#

but dont play it

#

until the function is called

onyx coral
#

I did also try that but I don't think that worked either

low badge
#

so when MouseButton1Click

onyx coral
#

I'll try it again though

low badge
#

we check if the animation is playing

#

and if it is play

#

if not

#

stop

onyx coral
#

if I got what you said correctly, shouldn't this work?

#

because it won't play the animation at all like this.

low badge
#

does it play only once? use .Looped = true

onyx coral
#

it should already play basically looped, because whenever it HAS been playing, it just won't stop at all.

low badge
#

try

#
local anim = humanoid:LoadAnimation(script.Animation)
onyx coral
#

it's not working

low badge
#

so the anim plays but doesnt stop?

onyx coral
#

no, like, putting the loading animation thing outside of the function just removes the ability to play the animation at all.

#

it just doesn't play like that.

low badge
#

thats strange

onyx coral
onyx coral
low badge
#

i made a bit that should stop all anims

#
for _, i:AnimationTrack in ipairs(humanoid:GetPlayingAnimationTracks()) do
    i:Stop()
end
#

what it does is

#
  • get playing animation tracks
  • stop them all
#

put it after the else

onyx coral
#

alr, I'll try that

undone mapleBOT
#

studio** You are now Level 2! **studio

onyx coral
#

nope.

#

I think the error is probably in the if statement, it seems like it just.... doesn't run the else part or something.

low badge
#

yea definetly

onyx coral
#

the question though is why

low badge
#

i would replace it with a boolean and set it to true or false

#

since it doesnt work

#
local isplaying = false

if isplaying == false then -- yea
end
onyx coral
#

like this?

#

I'll test it rq

low badge
#

yep

onyx coral
#

still not working

low badge
#

i dont even know now tf

#

oh you

#

wait

#

you didnt even load the animation

onyx coral
#

no, it's playing it fine

#

just still

#

wont stop

low badge
#

nvm

#

load the anim outside the event

onyx coral
#

as I've said before, when I've tried that, it just doesn't even play it

#

not sure why

low badge
#

no clue the

#

n

#

no idea at this point 🤷‍♂️

onyx coral
#

well. great XD.

#

and yeah I have no clue either. I don't know what's happening that makes it just refuse to stop