Change animation when Touched event


I am currently making a game. In it, there is a npc (he’s in the second floor) who goes in a vent that leads to the first floor (basically falls down), yet, there is a problem, when the animation is over he just doesn’t stay (as in the same pose when the anim is finished). While he falls and he’s at the end, he touches a part.

Currently what I did was when the npc touches the part, it does a :Destroy() and it :Clone() a character from ServerStorage and puts it in Workspace. The second character stands there and does another anim (just took the last frames from the previous one).

Also, worse, his torso his anchored, because the anim is him being on his back, his arms are out of the vent, his legs are in it and his torso is in between.

All I know, is that I could do something better.

Extra info:

(Based on memory)The first npc is using an idle meaning, in the Animate script where there are the anim and all that.

If there’s any confusion or details missing, please tell me, I can send video footage and screenshots. I may edit this post with visuals or something else.

Anyways, thanks for reading.

Could you please send video footage or possibly send the place link?

Sure! I’ll send screenshots right now. I do not know how to record videos on studio.

Here they are!
The vent from the second floor (without the character):

Now the vent from the first floor (with the character):
The inside vent, view from bottom to looking up:

The same but the character is going in it:

The character at the bottom vent:

I could also send an illustration of it. But please take note that today I have school, sometimes I’m not available.


Sorry for not responding much, I’ve been busy this lunch, and also as of rn, I have school (online), so school usually ends at 3:50pm, in my time. Rn it’s 2:05 pm. I’ll be available at 4:10pm.

@2406mmartin. Oh my. Sorry for forgeting about this. So first off here’s the script:


local hum = script.Parent:WaitForChild("Humanoid")

local anim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))

anim.Looped = false




game.ServerStorage.epicA1A:Clone().Parent = game.Workspace

Yeah, I forgot I wait 1 second for the first character to disappear.


robloxapp-20210503-0846420.wmv (638.2 KB)

Could you send a video of what you were wanting to avoid?
In this part, “there is a problem, when the animation is over he just doesn’t stay (as in the same pose when the anim is finished)”.

robloxapp-20210504-0751426.wmv (700.7 KB)

Couldn’t you just change the HumanoidRootPart’s position near the vent and then play the second animation?

I could try that, and also pause at the last frame of the first animation. The second doesn’t matter as it is not seen. But I will try to set the position.

When it’s falling, you could set a wait() till the NPC hits the ground, and as soon as it hits you could change its position to the bottom vent. You could create a part and place it near the vent, make it transparent, CanCollide off, and set the CFrame of the NPC’s HumanoidRootPart to the other part. That should prevent it from teleporting back up.

1 Like

I am so sorry for responding so slow, I will try to do what you proposed ASAP. I feel bad making you wait.

1 Like

I will try to do something like this: (Might have errors)
Not everything is specific, keeping it general.

local humpart = script.Parent.HumanoidRootPart
local Anim1 = script.Anim1
local Anim2 = script.Anim

function NewPart()
local NewBasePart ="Part")
NewBasePart.Name = "BVCFrame"
NewBasePart.Anchored = true
NewBasePart.Collision = false
NewBasePart.Transparency = 1
NewBasePart.Position = --The position
NewBasePart.Orientation = --I will try to make it’s front face look up.
NewBasePart.Size = --The HumanoidRootPart’s size


Anim1.Completed:Wait() --Here we play the first animation, wait for it to end to do the next lines of code. 
humpart.Position.CFrame = NewBasePart

@2406mmartin, I’ll show a video, I’ll make it so you can see the part.

robloxapp-20210507-1314515.wmv (763.2 KB)
robloxapp-20210507-1316094.wmv (435.1 KB)

Awesome, good luck on the rest of your game!

1 Like