Triggering a custom animation

basically trying to play a custom animation on an object when a player walks near. If I do transform animations in unity and create a tag, I can apply that tag to whatever and a simple player script with raycasting enabled will trigger the transform when a camera comes near it.
The issue I am having is with a custom animation applied to a mesh with bones.
I would assume that the same script would work, basically play animation when camera is within 10 units but it will not, it doesn’t find the animation.

This is the basic script I am using, ignore the naming of the objects, I have changed those to reflect the entity tag and the name of the custom animation.

472630–16609–$door.js (569 Bytes)

okay, so basically is there a tutorial on setting up an animated custom mesh that can have a trigger when touched or hit that someone can point me to…
Thanks

Could you make the contents of the if statement: Debug.Log(hit.collider.gameObject.animation.Play(“door_open”)); and see if it logs True or False?

Also, is the “door_open” animation in the list of animations available to that gameObject?