Description
The HeadWeight
property of the CitizenAnimationHelper
class is a float
value that determines the influence of the head's movement when the character is looking at a target. This property is part of the look-at system, which allows the character to focus on a specific GameObject
in the scene.
The value of HeadWeight
ranges from 0 to 1, where 0 means no influence (the head does not move towards the target) and 1 means full influence (the head fully aligns with the target).
Usage
To use the HeadWeight
property, ensure that the LookAtEnabled
property is set to true
. Adjust the HeadWeight
to control how much the character's head should turn towards the target specified by the LookAt
property.
Example usage:
var animationHelper = new CitizenAnimationHelper();
animationHelper.LookAtEnabled = true;
animationHelper.LookAt = targetGameObject;
animationHelper.HeadWeight = 0.75f; // The head will mostly align with the target
Example
// Create an instance of CitizenAnimationHelper
var animationHelper = new CitizenAnimationHelper();
// Enable the look-at feature
animationHelper.LookAtEnabled = true;
// Set the target GameObject to look at
animationHelper.LookAt = targetGameObject;
// Set the head weight to control the influence of the head's movement
animationHelper.HeadWeight = 0.75f; // The head will mostly align with the target