How do I make my animation play till the menu's visibility = false?

I’m trying to make a menu with a cool animation thing and I need it to close whenever the menu is closed.

6800622210 is the animation ID

I can’t seem to get this to work.

I’ve tried a few things, but all of them have failed. (yes I know this is simple but I forgot how to play animations soooooooo yeah)

--define the animation and animation id here, then play the animation normally.

while wait() do
    if Menu.Visible == false then
        --stop the animation here
        break
    end
end
1 Like

thats a simple way to do it, don’t know if that’s what you’re going for, though.

Is that a local or server side script?

I assume local since you should never handle anything to do with guis on the server.

typically same for animations lol

2 Likes

Is it an animation or a tween? That makes a big difference in what you want to do.

Animation. It gets the player and puts it in a frame. So i have to change the player’s animation and walkspeed.

Can you “re-explain” the whole process for me? It puts the character in a viewport frame then plays the animation on the character in the viewport?

If the issue is that the animation is not playing inside of a VPF then you need to have a world model inside of the VPF then the character inside of the world model

Yes, it takes a viewport of your avatar

It’s playing inside the frame, I’m trying to get it to play the right animation.

1 Like

Something like this?

local viewPortChar = script.Parent.ViewportFrame.CharacterModel
local anim = viewPortChar.Humanoid:LoadAnimation(anim)

Menu.Changed:Connect(function()
  if Menu.Visible == false then
    anim:Play()
  end
end)

It’s the real player though. Not a model.

Clone the real player, delete the Animate script then put the cloned player inside of the viewport frame.

1 Like

Nevermind my other developer is fixing it