Make a part disappear after an animation plays

Hello, Currently working on a little project.

I have a rig, with an animation all set up, and an invisible wall to stop the player from touching said rig before the animation finishes. The rig and wall are separate in the workspace.

My issue is, I can’t figure out a way to make it so that the wall disappears after the animation plays. I would use task.wait, however I plan on the animation itself playing when the player reaches a certain point in the game. So basically I need a way to sync the animations end with the wall’s disappearance, This is also a multiplayer project, it needs to run serversided.

All help is appreciated!

AggressiveClown

2 Likes

I am not sure if you meant the part disappearance ending along with the animation but if you would like to make it disappear after the animation has ended you can simply use Animation.Ended:Wait()

2 Likes

So basically the idea is.
You enter a room with a rig and an invisible wall, the r6 rig plays an animation, once the animation ends, and the invisible wall’s collision is disabled.

My issues right now are syncing up the animation ending and the wall losing collision
and now that i think of it, making the animation itself serversided is something i do not remember how to do

You can refer to my reply above to fix this solution. Animation.Ended fires whenever an animation fully ends, make sure this “Animation” variable is an Animator playing it though. You said you don’t remember playing them on the server, you can use something like this for that:

local animator = Instance.new("Animator", rig.Humanoid)

local anim = Instance.new("Animation")
anim.AnimationId = "ID"

local Animation = animator:LoadAnimation(anim)
Animation:Play()
Animation.Ended:Wait()

rig is your r6 dummy.

1 Like

so i modified it a little

local animator = Instance.new("Animator", script.Parent.Humanoid)

local anim = Instance.new("Animation")
anim.Parent = animator
anim.AnimationId = "12864601374278"

local Animation = animator:LoadAnimation(anim)
Animation.IsPlaying = true
Animation.Ended:Wait()
game.Workspace.InvisWall.CanCollide = false
game.Workspace.InvisWall.Transparency = 1

using the code you provided doesn’t work, neither does any of my attempts at fixing it

ohh im stupid, rbxassetid and switching back to animation:play() worked

now just to figuring out how im going to get it to play when the room is entered by every player on a server…

I’ll give you the solution and then ask around the devforum for the second part of my idea!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.