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

Oh, I think that’s the problem. Trying it out now…

It still doesn’t work, now what?

My class is about to start, I’ll check later. In the meantime, can you send your current code and the hierarchy here @xander5610 ?

1 Like

I’m pretty sure you did this but proof read. Check to make sure everything is spelled right and you have capitals where you’re supposed to

Yep, I did that. I copy and pasted and then changed what I had to. It’s all correct.

Look at your screenshots again. It says you are trying to call a nil value

Check for errors. If there are any what are they?

Thatt’s something else. I think it’s a plugin and I’m positive it has nothing to do with the animation.

This is what I’ve got:


I see the problem. Try replacing the script with a ​LocalScript​ ​.

It’s not a plug-in. Plug-ins show icon errors (or at least for me) saying that the icon cannot load. Something has to named wrong. That’s what attempting to call a nil value means

Which one? Anything or AnimationScript?

The AnimationScript should be changed

1 Like

Well I don’t have any other scripts and this happens in all of my other games so I have no idea what it is.

In the most recent screenshot I didn’t see any errors that occurred recently so I think you’re ok now on the errors part

Did that, still doesn’t work. Anything else?

What is every single line of code that you wrote for the animation?

It’s all in the two screenshots above, the animation is 4 seconds long.

I think Ik what’s wrong. In the AnimationPart I think you need to hit the plus sign and add an animation. (I don’t remember if you can do that. Sadly I’m in my phone rn so I can’t check). Keep the scripts the same but add the animation to the part

1 Like

Ok, I just did that and copy and pasted the animation id but nothing happens when I touch the part.

Do I have to unanchor it?