animation won't complete unless mesh is visible in scene view, where ever main camera is looking

I have a scene with a character in it. The main camera starts looking at the character. When running in the editor, if the scene camera is looking away from the character, the character never appears in the game window. As soon as I rotate the scene camera to face the character, he appears on screen in the game window.

Why would the scene camera be being used for culling in the game window, and how can I stop it?

As part of the game start sequence, the character’s custom animation controller script and its animation component both get disabled, then a few frames later enabled. Then it starts playing an animation. The animation component stays enabled, but while the character is not being rendered it never reports completion of the animation.

As soon as the scene camera allows the character to start rendering again, the animation instantly completes. Debug logging of the animation state shows that it’s enabled but normalizedTime is stuck at the first frame.

After moving the scene camera to look at the camera, I can move it away again with no ill effects.

I can’t reproduce this in a windows build, but when our build server spits back an iOS build it seems to suffer from the problem. I haven’t had a chance to debug that build yet.

I got an identical effect when I had a lodding component on the character and the scene camera was looking at the character but was far enough away to be culled. I removed the lodding component and that problem went away, but it implies this is a culling issue.

Sorry for the wall of text, but I can’t share code and I wanted to give as much context as possible.

Find the Animation component on the GameObject, under culling type. Select “Always animate”.