The resulting TBG Renderer prefab contains a full hierarchy of Transforms and SpriteRenderers to display the character in a Unity-friendly rig. Additionally, a TBG Renderer script is included that ensures Sprites are swapped during an animation’s progress and cutters properly apply to relevant SpriteRenderers.
Adding Inverse Kinematics to a TBG Renderer Prefab
You can utilize Unity’s own 2D Inverse Kinematics feature to add procedural targets to your characters limbs. You can use SLY_Character from the TBG Workflow example scene for this process.
-
Find and drag SLY_Character from the Project view to your Scene view, and press F to frame the character in your view.
NOTE Ensure the SLY_Character is selected in the hierarchy. -
In the Inspector view, add an IK Manager 2D component.
-
In the IK Manager 2D component, click the + button to add a new IK solver, and select Limb.
-
Click the bottom-right bone of Sly’s legs to expose its place in the hierarchy. We will be using its sibling GameObject that has “..._GameBone_1_end” in the name.
-
With the “New LimbSolver2D” Game Object selected, drag “New LimbSolver2D” into the Target slot of the LimbSolver2D script and drag the “_leg_cuff_GameBone_1_end” GameObject into the Effector slot.
Once this is done, you can move around the New LimbSolver2D transform and see the limb bend to match the target.
To switch the direction the knee bends, we can click the “Flip” checkbox in the Limb Solver 2D component.
Comments
0 comments
Article is closed for comments.