bool LookAtEnabled { get; set; }

robot_2Generated
code_blocksInput

Description

The LookAtEnabled property determines whether the Citizen character is actively looking at a specified target. This is particularly useful in scenarios such as cutscenes, where you want the character to focus their gaze on a specific object or another character.

Usage

To enable the look-at behavior for a Citizen character, set the LookAtEnabled property to true. Ensure that the LookAt property is also set to a valid GameObject that the character should focus on. Adjust the EyesWeight, HeadWeight, and BodyWeight properties to control the influence of the look-at behavior on different parts of the character's body.

Example

// Example of enabling the look-at feature for a Citizen character
var citizenAnimationHelper = new CitizenAnimationHelper();

// Enable the look-at feature
citizenAnimationHelper.LookAtEnabled = true;

// Set the target GameObject to look at
citizenAnimationHelper.LookAt = someTargetGameObject;

// Optionally adjust weights
citizenAnimationHelper.EyesWeight = 0.8f;
citizenAnimationHelper.HeadWeight = 0.5f;
citizenAnimationHelper.BodyWeight = 0.3f;