Making animations stop following a collision

I am making a training game to demonstrate effects of terrain on radio waves. I have animations emitted from radio towers out to a maximum radius. Students will place the towers on 3D terrain. When the animation (indicating area of coverage) hits a ridge, I would like it to stop expanding and start over again from the beginning. In other words, if a tower is near a ridge, only the first 20% of the animation might loop repeatedly, but farther away more or even all of the animation would loop.

At first, I assumed the ridge terrain would block the animation, and indeed the part of the animation on the ridge is hidden by the terrain, but then it continues on the other side of the ridge. I then created enormous invisible (mesh renderer off) rigidbody “ridges” on the ridge lines with the tag “Ridge” and believe I am successfully testing for that tag OnCollision via debug statements. The animation has “Animate Physics” checked, and the Ridges are kinematic. But I’ve not been able to make the animation end and restart up first collision with a ridge. I’ve tried both Rewind and Start but I’m not sure my formatting is correct.

Any suggestions or sample code for something like this?

Your problem is more complex than it might seem, but it basically depends on what you’re calling ‘animations’.
If there’s meshes on the ‘waves’ you’re using (for example if you’re instantiating a prefab or primitive), you need to assign the ‘wave’ thing to a prefab, to which you add a script and a collider.
Then using OnCollisionEnter or OnTriggerEnter (based on what your map is made with -meshes or triggers-), your wave prefab destroys the object.

If your animation is just an animation and the waves are a visible effect that you can’t prefab singularly (for example an animation from a 3d file with a common mesh), you need to manipulate the animation’s timeline with

animation[“waves”].normalizedTime or
animation[“xx”].time

but in this case things get nasty since you need to calculate the animation time based on the distance between the tower and the object that the waves collide with.