Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question m_rig.setActive(false) or set weight = 0

Discussion in 'Animation Rigging' started by tree_arb, Jan 20, 2021.

  1. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    325
    With Animation rigging package:

    I have a few rigs on a character that I toggle the weights to zero, only one rig will be on at a time.

    if not in use, should I set other rigs game objects to setActive(false) or just set the weight to zero on all of them and leave the game objects on

    ...or does it not matter
     
  2. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi,
    It's the same thing, disabling a rig or setting its weight to zero implies the rig is evaluated with a weight of zero.
     
  3. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    325
    ok thanks. I was first learning it that day it makes sense to me now.

    I suppose I should profile it to find out if there is anything different as far as performance.
     
  4. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    325
    Updated answer to my original question which title was slightly confusing.

    I have "Empty" game objects inside my Player that only hold the rigs and constraints that reference the players bones.

    If I disable the game object holding the rig, before or during the game, the rigs are still fully working 100%.

    In my setup, the players root (this game object is enabled) has the rig builder which still references the rigs, it does not matter if the rigs themselves are on a disable game object or not they still fully run.

    so, disabling just the game object holding the rig does not do anything when rig builder is referencing them and weight is on.