1. Hi! Welcome to VRCat.club. This forum is now obsolete with the release of the official Ask VRChat forums. Please go there instead! Over time, this forum will be set to read only, and eventually removed. Move your threads and content! https://ask.vrchat.com/

Avatars Making Final IK Behave Correctly on Avatars

Discussion in 'Tutorials and Tools' started by TCL987, Apr 5, 2018.

  1. TCL987

    TCL987 New Member

    Joined:
    Nov 15, 2017
    Messages:
    6
    Likes Received:
    8
    VRChat:
    TCL987
    Final IK can be used to add additional IK to parts of avatars. An example of this is using the Aim IK component to add a turret that is aimed based on the direction you are pointing.

    The purpose of this guide is not to explain how to use Final IK; the Final IK User Manual can be found here: http://www.root-motion.com/finalikdox/html/page1.html. The purpose of this guide is to explain the necessary steps required to ensure that additional Final IK scripts behave correctly.

    In order for Final IK scripts added to avatars to behave correctly they must be run in the correct order. Final IK includes a script to control the execution order of Final IK scripts.
    upload_2018-4-4_20-30-9.png

    This script allows you to specify the order Final IK components should be executed. In order for additional IK components to behave correctly they must be executed in the correct order relative to VRChat's VR IK component. In most cases we will want our IK to run after VRChat's IK so that its result will take our avatar's position into account.

    To ensure that the VRChat IK is executed before our IK we need to add an IK Execution Order component to the parent GameObject of our avatar, and make sure VRChat's IK is the first IK Component.
    upload_2018-4-4_21-31-21.png upload_2018-4-4_21-31-54.png

    Normally because the VR IK component is added by VRChat we wouldn't be able to include it in the execution order script. Fortunately if a VR IK component is already present on the avatar VRChat will overwrite its configuration and use it instead of adding its own. This means that we can add a VR IK component to the parent GameObject of our avatar and then add it to the first slot in the IK Components array. Then add any additional IK components after it.

    To add an IK component to the list click the circle next to the slot and select it from the list or drag-and-drop the GameObject containing the component onto the desired slot. Also add the GameObject containing the avatar's animator to the animator slot.

    For example this is how I setup an Aim IK component to aim a drone turret. The turret is aiming at a target that is a child of my finger so that the drone turret aims where I'm pointing. Since the target is on my hand the VRChat IK must run before my drone's Aim IK; otherwise the drone will aim wherever the idle animation has my avatar pointing.
    upload_2018-4-4_20-30-9.png

    One issue that this will cause is that your preview avatar will have uninitialized IK running on it which will cause it to behave strangely. To avoid this you can configure the VR IK script's Solver->IK Position Weight setting to zero.
    upload_2018-4-4_23-33-42.png

    Alternatively just disabling the VR IK script may solve this as well but I haven't tested this so it may just break IK if VRChat doesn't re-enable it.
     
  2. TCL987

    TCL987 New Member

    Joined:
    Nov 15, 2017
    Messages:
    6
    Likes Received:
    8
    VRChat:
    TCL987
    Reserved.
     
  3. TCL987

    TCL987 New Member

    Joined:
    Nov 15, 2017
    Messages:
    6
    Likes Received:
    8
    VRChat:
    TCL987
    Also this doesn't work with full body tracking because full body tracking uses the FBB IK component instead of the VR IK component. It might be enough to replace the VR IK component for the FBB IK component but I don't have full body tracking to test it.
     
  4. Jwguy

    Jwguy New Member

    Joined:
    Jul 10, 2018
    Messages:
    1
    Likes Received:
    0
    VRChat:
    Jwguy
    There do seem to be issues with ragdolling that result from using Final IK and the Execution Script/VRIK.

    For example, playing a game type like "Steel and Gold" and dying while using an avatar with these components, seems to cause the avatar to burst into a small tornado of colors until respawning.