How do I play an animation when the player touches the part?

Do you have a script that checks if the part is touched?

Yep, that part is in Anything which is the script under the part.

Well I’m out of ideas. Hopefully you find someone that can help. Good luck!

1 Like

The touched function gets the part that touched it, not the model. so you have to get the Parent of the part first before finding the animation. EDIT: @xander5610 replied to the wrong person
So the code would be:

script.Parent.Touched:Connect(function(hit)
   local parent = hit.Parent
   local script = parent:FindFirstChild("AnimationScript")
   if script then
      script.BoolValueName.Value = true
   end
end)

When did I reply to the wrong person?

Just tried this, doesn’t work.

Did you replace BoolValueName with the name of the bool value? Also,
i meant that I replied to the wrong person

Yep, I changed the name of my BoolValue and then changed BoolValueName to the name of my BoolValue. I also made the transparency 0 instead of 1.

Can I see the output and your current code?

Here:

1 Like

I don’t understand why thing is not valid. Let me see the properties (and probably children) of Thing please. also why is there an animation inside the touched part?

1 Like

Here’s the properties:

It’s probably because value isn’t checked… right?

1 Like

No, that means the value is false. I don’t know why this happens. I’ll check it later.

2 Likes

Well I gtg now so I’ll be back tomorrow if you think of anything.

1 Like

Try using find first child when finding the bool value.