Hi We are looking to create a trigger based animation within unity where when the camera approaches 50 units from the (invisible) object it then animates. When the camera is then 5 units away from the object it then de-animates. Is this possible? How would I go about achieving this? Thanks
Use SphereColliders with IsTrigger ticked. It's probably easiest to add them as two separate child objects (50-unit child and 5-unit child). Write a small script that starts the animation in OnTriggerEnter() and assign it to the 50-unit child. Write another that stops it in OnTriggerExit() and assign it to the 5-unit child. Instead of jumping straight into the primary animation, you can create a ramp-up animation that transitions into the primary animation, and similarly for a ramp-down animation.
If you check out my 1st person animation thread, it contains a controller which fades between animations using Unity 3D's Mecanim Legacy Controller. Try it out. Also has 40 starter animations (currently).