Hey there,
I have a skinned character mesh. In one of the animations, the character walks out of the screen. The animation is done in a way, that the character walk out of its origin. The animation of the caracter pauses, if he walked out of the screen. But I want the animation to continue, because that gamelogic waits for it. I have the following code:
//1
foreach ( SkinnedMeshRenderer r in skaterModel.GetComponentsInChildren<SkinnedMeshRenderer>() )
r.updateWhenOffscreen = true;
//2
foreach ( Animation a in skaterModel.GetComponentsInChildren<Animation>() )
a.cullingType = AnimationCullingType.AlwaysAnimate;
The problem now is:
When I only have block //1 active the character does NOT get animated if it disappears from the screen.
When I have block //1 and //2 active, the character is not animated at all, no matter which animation I play.
Can anyone explain to me, which part of updateWhenOffscreen and AlwaysAnimate I did not understand?
Does anyone another solution to this kind of problem?
Thanks and best regards
– Benjamin Schulz
I've experienced something very similar. My solution was to disable and enable the Animation component just after setting the cullingType. It seems like a bug to me, but this fixed my issue for now.
– anon18031359