Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

How to create Rig Effectors from a script and add to rigging constraints

Discussion in 'Animation Rigging' started by akent99, Nov 19, 2020.

  1. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I have a series of characters with identical bone structures (coming from VRoid Studio). I am writing a script to add Bone Renderer, Rig/RigBuilder/TwoBoneIKConstraints etc for arms and legs. That is all working.

    But I am stuck trying to script the adding of red balls (BallEffector) to the "Left Hand IK_target" constraints etc, like in the Unity demo video (done manually).

    I found the RigEffectorData etc classes (e.g. struct RigEffectorData.Style) and created an instance of them (without compile errors at least!). But I could not find an example of how to associate a RigEffectorData instance to the LeftHandIK_target node in the scene.
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Ah, worked it out. Finally noticed Rig and RigBuilder have the AddEffector() method. The online docs left out the relevant interface function they both inherit from. Got it all working!