Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Huge performance impact on enable/disable

Discussion in 'Animation Rigging' started by robertsze, Sep 6, 2023.

  1. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    We use the animation rigging package in our game and basically everything works fine and as expected, we just have one major performance issue.

    For render textures (overlay on the UI to select the character) we have to
    - enable gameobject containing RigBuilder as child
    - render the character
    - disable gameobject containing RigBuilder as child

    Every enable of the gameobject containing the RigBuilder needs more than 100ms (for 4 RigBuilders) inside Rigbuilder.OnEnable. Looks like everything is built/setup again although nothing did really change, is there maybe a workaround for this issue?

    (We need to enable/disable up to 6 rig builders per frame)
     
  2. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    I can more or less workaround this by not calling Build / onAddRigBuilder again if the object was enabled already, but not sure about any side effects here
    upload_2023-9-6_9-10-19.png