Skip to content

Commit 20e296e

Browse files
Fix warnings caused by animation randomizer running on disabled GameObjects (#268)
1 parent a377a5b commit 20e296e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/AnimationRandomizer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public class AnimationRandomizer : Randomizer
2020

2121
void RandomizeAnimation(AnimationRandomizerTag tag)
2222
{
23+
if (!tag.gameObject.activeInHierarchy)
24+
return;
25+
2326
var animator = tag.gameObject.GetComponent<Animator>();
2427
animator.applyRootMotion = tag.applyRootMotion;
2528

0 commit comments

Comments
 (0)