This class allows for a 3D character to grab its current weapon's handles, and look wherever it's aiming. There's a bit of setup involved. You need to have a CharacterHandleWeapon component on your character, it needs an animator with IKPass active (this is set in the Layers tab of the animator) the animator's avatar MUST be set as humanoid And you need to put that script on the same gameobject as the animator (otherwise it won't work). Finally, you need to set left and right handles (or only one of these) on your weapon(s).
More...
|
virtual void | SetHandles (Transform leftHand, Transform rightHand) |
| Binds the character hands to the handles targets More...
|
|
|
virtual void | Start () |
|
virtual void | OnAnimatorIK (int layerIndex) |
| During the animator's IK pass, tries to attach the avatar's hands to the weapon More...
|
|
virtual void | AttachHandToHandle (AvatarIKGoal hand, Transform handle) |
|
virtual void | DetachHandFromHandle (AvatarIKGoal hand) |
| Detachs the hand from handle, if the IK is not active, set the position and rotation of the hand and head back to the original position More...
|
|
This class allows for a 3D character to grab its current weapon's handles, and look wherever it's aiming. There's a bit of setup involved. You need to have a CharacterHandleWeapon component on your character, it needs an animator with IKPass active (this is set in the Layers tab of the animator) the animator's avatar MUST be set as humanoid And you need to put that script on the same gameobject as the animator (otherwise it won't work). Finally, you need to set left and right handles (or only one of these) on your weapon(s).
◆ AttachHandToHandle()
virtual void MoreMountains.CorgiEngine.WeaponIK.AttachHandToHandle |
( |
AvatarIKGoal |
hand, |
|
|
Transform |
handle |
|
) |
| |
|
protectedvirtual |
◆ DetachHandFromHandle()
virtual void MoreMountains.CorgiEngine.WeaponIK.DetachHandFromHandle |
( |
AvatarIKGoal |
hand | ) |
|
|
protectedvirtual |
Detachs the hand from handle, if the IK is not active, set the position and rotation of the hand and head back to the original position
- Parameters
-
◆ OnAnimatorIK()
virtual void MoreMountains.CorgiEngine.WeaponIK.OnAnimatorIK |
( |
int |
layerIndex | ) |
|
|
protectedvirtual |
During the animator's IK pass, tries to attach the avatar's hands to the weapon
◆ SetHandles()
virtual void MoreMountains.CorgiEngine.WeaponIK.SetHandles |
( |
Transform |
leftHand, |
|
|
Transform |
rightHand |
|
) |
| |
|
virtual |
Binds the character hands to the handles targets
- Parameters
-
leftHand | Left hand. |
rightHand | Right hand. |
◆ Start()
virtual void MoreMountains.CorgiEngine.WeaponIK.Start |
( |
| ) |
|
|
protectedvirtual |
◆ _animator
Animator MoreMountains.CorgiEngine.WeaponIK._animator |
|
protected |
◆ _leftHandTarget
Transform MoreMountains.CorgiEngine.WeaponIK._leftHandTarget = null |
|
protected |
◆ _rightHandTarget
Transform MoreMountains.CorgiEngine.WeaponIK._rightHandTarget = null |
|
protected |
The documentation for this class was generated from the following file:
- Assets/CorgiEngine/Common/Scripts/Agents/Weapons/WeaponIK.cs