- Home /
How to toggle Mesh Render Enabled from Parent animation time?
I have imported an animated 3dsmax scene into Unity. It is a big scene with many objects, groups, parent/child connections etc. The scene has in Max some objects that have their visibility turned on/off at certain frames, but Unity does not support importing this.
I have been looking into a way of scripting an animated variable for setting the renderer.enabled on these objects, but so far I have no luck. I guess the easiest is adding a visibilty script on to the objects that I want to hide, and looking at animation.time is the best solution. But there is only an Animation Component connected to the first parent object/scene. I guess I have to reference this into the script for looking at the current time in the "global animation"? The animation is also looping, so I need to reset everything when it loops.
Does anyone have any suggestions on how to solve this?