Handles smooth aim target switching, weight blending, target interpolation and root rotation. More...
Inherits MonoBehaviour.
Public Attributes | |
AimIK | ik |
Reference to the AimIK component. More... | |
float | weight = 1f |
Master weight of the IK solver. More... | |
Transform | target |
The target to aim at. Do not use the Target transform that is assigned to AimIK. Set to null if you wish to stop aiming. More... | |
float | targetSwitchSmoothTime = 0.3f |
The time it takes to switch targets. More... | |
float | weightSmoothTime = 0.3f |
The time it takes to blend in/out of AimIK weight. More... | |
bool | smoothTurnTowardsTarget = true |
Enables smooth turning towards the target according to the parameters under this header. More... | |
float | maxRadiansDelta = 3f |
Speed of turning towards the target using Vector3.RotateTowards. More... | |
float | maxMagnitudeDelta = 3f |
Speed of moving towards the target using Vector3.RotateTowards. More... | |
float | slerpSpeed = 3f |
Speed of slerping towards the target. More... | |
float | smoothDampTime = 0f |
Smoothing time for turning towards the yaw and pitch of the target using Mathf.SmoothDampAngle. Value of 0 means smooth damping is disabled. More... | |
Vector3 | pivotOffsetFromRoot = Vector3.up |
The position of the pivot that the aim target is rotated around relative to the root of the character. More... | |
float | minDistance = 1f |
Minimum distance of aiming from the first bone. Keeps the solver from failing if the target is too close. More... | |
Vector3 | offset |
Offset applied to the target in world space. Convenient for scripting aiming inaccuracy. More... | |
float | maxRootAngle = 45f |
Character root will be rotate around the Y axis to keep root forward within this angle from the aiming direction. More... | |
bool | turnToTarget |
If enabled, aligns the root forward to target direction after 'Max Root Angle' has been exceeded. More... | |
float | turnToTargetTime = 0.2f |
The time of turning towards the target direction if 'Max Root Angle has been exceeded and 'Turn To Target' is enabled. More... | |
bool | useAnimatedAimDirection |
If true, AimIK will consider whatever the current direction of the weapon to be the forward aiming direction and work additively on top of that. This enables you to use recoil and reloading animations seamlessly with AimIK. Adjust the Vector3 value below if the weapon is not aiming perfectly forward in the aiming animation clip. More... | |
Vector3 | animatedAimDirection = Vector3.forward |
The direction of the animated weapon aiming in character space. Tweak this value to adjust the aiming. 'Use Animated Aim Direction' must be enabled for this property to work. More... | |
Handles smooth aim target switching, weight blending, target interpolation and root rotation.