Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.Char Class Reference
Inheritance diagram for AC.Char:
AC.ITranslatable AC.NPC AC.Player

Public Member Functions

virtual bool IsCapableOfJumping ()
 
virtual bool IsActivePlayer ()
 
virtual void _Update ()
 
virtual void _LateUpdate ()
 
virtual void _FixedUpdate ()
 
void RecalculateActivePathfind ()
 
bool AccurateDestination ()
 Checks if the character should attempt to be as accurate as possible when moving to a destination. More...
 
void Teleport (Vector3 _position, bool recalculateActivePathFind=false)
 Teleports the character. The message 'OnTeleport' will be sent to the character's GameObject after the position is set. More...
 
void SetRotation (Quaternion _rotation)
 Instantly rotates the character More...
 
void SetRotation (float angle)
 Instantly rotates the Player More...
 
void StopTurning ()
 
virtual void StopTankTurning ()
 
float GetAngleDifference ()
 Gets the difference between the character's current facing angle, and the angle they wish to face. More...
 
void SetLookDirection (Vector3 _direction, bool isInstant)
 Sets the intended direction to face. More...
 
void SetMoveDirection (Vector3 _direction, bool useSmoothing=false)
 Moves the character in a particular direction. More...
 
void SetMoveDirectionAsForward ()
 
void SetMoveDirectionAsBackward ()
 
Animation GetAnimation ()
 Gets the character's Animation component. More...
 
Animator GetAnimator ()
 Gets the character's Animator component. An Animator placed on the spriteChild GameObject will be given priority. More...
 
void ResetAnimator ()
 
Vector3 GetMoveDirection ()
 Gets the direction that the character is moving in. More...
 
bool WillStopAtNextNode ()
 Checks if the character is pathfinding, and the next node on the path will be their intended destination More...
 
bool IsPathfinding ()
 Checks if the character is currently pathfinding to a pre-determined destination More...
 
void EndPath (Paths optionalPath, bool stopTurningToo=true)
 Stops the character from moving along the current Paths object. More...
 
void StartDecelerating ()
 
virtual void EndPath ()
 
void ResumeLastPath ()
 
void ForgetLastPath ()
 
void Halt (bool haltTurning=true)
 Stops the character moving. More...
 
void ForceIdle ()
 
bool IsTurningBeforeWalking ()
 Checks if the character is spot-turning before making their move. isTurningBeforeWalking must be True for this to ever be the case. More...
 
void SetPath (Paths pathOb, PathSpeed _speed)
 Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More...
 
void SetPath (Paths pathOb)
 Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More...
 
void SetPath (Paths pathOb, int _targetNode, int _prevNode)
 Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More...
 
void SetPath (Paths pathOb, int _targetNode, int _prevNode, bool affectY)
 Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More...
 
Paths GetPath ()
 Gets the current Paths object that the character is moving along. If the character is pathfinding, the Paths component on the character's root will be returned. More...
 
int GetTargetNode ()
 
int GetPreviousNode ()
 
Paths GetLastPath ()
 
void MoveToPoint (Vector3 point, bool run=false, bool usePathfinding=false)
 Moves towards a point in the scene. More...
 
void MoveAlongPoints (Vector3[] pointData, bool run, bool allowUpdating=true)
 Moves along a series of points in the scene. More...
 
void ResetBaseClips ()
 
float GetSpriteAngle ()
 Gets the angle that a 2D character's sprite is facing, relative to the root. More...
 
string GetSpriteDirection (bool ignoreFrameFlipping=false)
 Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR". More...
 
int GetSpriteDirectionInt (bool ignoreFrameFlipping=false)
 Gets the direction that a 2D character is facing (Down = 0, Left = 1, Right = 2, Up = 3, DownLeft = 4, DownRight = 5, UpLeft = 6, UpRight = 7) More...
 
void SetSpriteDirection (CharDirection direction)
 Locks a 2D character's sprite to face a particular direction. More...
 
void ResetAnimationEngine ()
 
float FlattenSpriteAngle (float angle, AngleSnapping _angleSnapping)
 Snaps a given angle to the nearest 90 or 45 degrees More...
 
void SetSorting (int order)
 Locks the Renderer's sortingOrder. More...
 
void SetSorting (string layer)
 Locks the Renderer's sorting layer. More...
 
void ReleaseSorting ()
 
float GetMoveSpeed (bool reduceNonFacing=false)
 Gets the current movement speed. More...
 
virtual void SetHeadTurnTarget (Transform _headTurnTarget, Vector3 _headTurnTargetOffset, bool isInstant, HeadFacing _headFacing=HeadFacing.Manual)
 Controls the head-facing position. More...
 
void ClearHeadTurnTarget (bool isInstant, HeadFacing _headFacing)
 Ceases a particular type of head-facing. More...
 
void ClearHeadTurnTarget (bool isInstant)
 Stops the head from facing a fixed point. More...
 
void SnapHeadMovement ()
 
bool IsMovingHead ()
 Checks if the head is rotating to face its target, but has not yet reached it. More...
 
Shapeable GetShapeable ()
 Gets the Shapeable script component attached to the GameObject's root or child. More...
 
Vector3 GetHeadTurnTarget ()
 Gets the position of where the character's head is facing towards. More...
 
Transform GetHandTransform (Hand hand)
 
bool HoldObject (GameObject objectToHold, Hand hand)
 Parents an object to the character's hand More...
 
void ReleaseHeldObjects (bool delete)
 
void ReleaseHeldObject (Hand hand, bool delete)
 
Vector3 GetSpeechWorldPosition ()
 Gets the position of the top of the character, in world-space. More...
 
Vector2 GetSpeechScreenPosition (bool keepWithinScreen=true)
 Gets the position of the top of the character, in screen-space. More...
 
void StartLipSync (List< LipSyncShape > _lipSyncShapes)
 Begins a lip-syncing animation based on a series of LipSyncShapes. More...
 
int GetLipSyncFrame ()
 Gets the current lip-sync frame. More...
 
float GetLipSyncNormalised ()
 Gets the current lip-sync frame, as a fraction of the total number of phoneme frames. More...
 
bool LipSyncGameObject ()
 Checks if the character is playing a lip-sync animation that affects the GameObject. More...
 
void StopSpeaking ()
 
int GetExpressionID (string expressionLabel)
 Gets the ID number of the Expression that has a specific label. More...
 
int GetExpressionID ()
 Gets the ID number of the currently-active Expression. More...
 
void ClearExpression ()
 Clears the current Expression so that the default portrait icon is used. More...
 
void SetExpression (int ID)
 Changes the active Expression. More...
 
void SetExpression (string _name)
 Changes the active Expression. More...
 
CursorIconBase GetPortrait ()
 Gets the active portrait that's displayed in a MenuGraphic element when the character speaks. The portrait can change if an Expression has been defined. More...
 
bool IsGrounded (bool reportError=false)
 Checks if the character (if 3D) is in contact with the ground. More...
 
MotionControl GetMotionControl ()
 Gets the extent to which motion is controlled by the character script (Automatic, JustTurning, Manual). More...
 
Vector3 GetTargetPosition (bool wantFinalDestination=false)
 Gets the character's destination when walking along a path. More...
 
Quaternion GetTargetRotation ()
 Gets the character's target rotation. More...
 
Quaternion GetFrameRotation ()
 Gets the character's calculated rotation for this frame. This is not the same as GetTargetRotation, which is the 'final' rotation, but instead the rotation that a smoothly-rotated character should take. More...
 
AnimEngine GetAnimEngine ()
 Gets the character's AnimEngine ScriptableObject. More...
 
void SetAnimEngine (AnimationEngine _animationEngine, string customClassName="")
 Sets the character's AnimEngine ScriptableObject. More...
 
float GetHeightChange ()
 Gets the character's change in height over the last frame. More...
 
bool IsReversing ()
 Checks if the character is moving backwards. More...
 
virtual float GetTurnFloat ()
 Gets the rate at which the character is turning (negative values used when turning anti-clockwise). More...
 
bool IsTurning ()
 Checks if the character is turning. More...
 
bool IsTurning (float maxAngleThreshold)
 Checks if the character is turning. More...
 
bool IsMovingAlongPath ()
 Checks if the character is moving along a path. More...
 
string GetName (int languageNumber=0)
 Gets the Character's current display name. More...
 
void SetName (string newName, int _lineID)
 Renames the Character mid-game. More...
 
void SetSpeechVolume (float volume)
 Updates the volume level of the Character's speech audio. More...
 
Speech GetCurrentSpeech ()
 Gets the character's current speech line More...
 
void OnEnterTimeline (PlayableDirector director, int trackIndex)
 Called whenever the character is bound to a Timeline track that's starting, and used to deactivate certain control components to allow them freedom. More...
 
void OnExitTimeline (PlayableDirector director, int trackIndex)
 Called whenever the character is bound to a Timeline track that's ending, and used to re-activate certain control components. More...
 
Sprite GetPortraitSprite ()
 Gets a Sprite based on the portrait graphic of the character. If lipsincing is enabled, the sprite will be based on the current phoneme. More...
 
string GetTranslatableString (int index)
 Gets the text to be translated, given its index. More...
 
int GetTranslationID (int index)
 Gets the translation ID of a given text index. More...
 
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index. More...
 
void UpdateTranslatableString (int index, string updatedText)
 
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts. More...
 
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID. More...
 
void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index More...
 
string GetOwner (int index)
 Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More...
 
bool OwnerIsPlayer (int index)
 Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More...
 
bool CanTranslate (int index)
 Checks if a given text index can and should be translated. More...
 
void SetTimelineHeadTurnOverride (Transform _timelineHeadTurnTarget, Vector3 _timelineHeadTurnTargetOffset, float _timelineHeadTurnWeight)
 
void ReleaseTimelineHeadTurnOverride ()
 

Public Attributes

CharState charState
 
AnimationEngine animationEngine = AnimationEngine.SpritesUnity
 
string customAnimationClass = ""
 
MotionControl motionControl = MotionControl.Automatic
 
TalkingAnimation talkingAnimation = TalkingAnimation.Standard
 
bool separateTalkingLayer = false
 
string speechLabel = ""
 
int lineID = -1
 
int displayLineID = -1
 
Color speechColor = Color.white
 
CursorIconBase portraitIcon = new CursorIconBase ()
 
bool useExpressions
 
List< Expressionexpressions = new List<Expression> ()
 
Transform speechMenuPlacement
 
bool mapExpressionsToShapeable = false
 
int expressionGroupID
 
float expressionTransitionTime = 0.2f
 
float lipSyncBlendShapeSpeedFactor = 1f
 
bool isLipSyncing = false
 
string phonemeParameter = ""
 
string phonemeNormalisedParameter = ""
 
int lipSyncGroupID
 
Transform leftHandBone
 
Transform rightHandBone
 
AnimationClip idleAnim
 
AnimationClip walkAnim
 
AnimationClip runAnim
 
AnimationClip talkAnim
 
AnimationClip turnLeftAnim
 
AnimationClip turnRightAnim
 
AnimationClip headLookLeftAnim
 
AnimationClip headLookRightAnim
 
AnimationClip headLookUpAnim
 
AnimationClip headLookDownAnim
 
Transform upperBodyBone
 
Transform leftArmBone
 
Transform rightArmBone
 
Transform neckBone
 
float animCrossfadeSpeed = 0.2f
 
int groundCheckLayerMask = 1
 
string moveSpeedParameter = "Speed"
 
string verticalMovementParameter = ""
 
string isGroundedParameter
 
string jumpParameter = ""
 
string turnParameter = ""
 
string talkParameter = "IsTalking"
 
string directionParameter = "Direction"
 
string angleParameter = "Angle"
 
string headYawParameter = ""
 
string headPitchParameter = ""
 
string expressionParameter = ""
 
float rootTurningFactor = 0f
 
int headLayer = 1
 
int mouthLayer = 2
 
Animator customAnimator
 
float turningAngleThreshold = 4f
 
bool listExpectedAnimations
 
bool turn2DCharactersIn3DSpace = true
 
Transform spriteChild
 
RotateSprite3D rotateSprite3D = RotateSprite3D.CameraFacingDirection
 
string idleAnimSprite = "idle"
 
string walkAnimSprite = "walk"
 
string runAnimSprite = "run"
 
string talkAnimSprite = "talk"
 
bool lockScale = false
 
float spriteScale = 1f
 
bool lockDirection = false
 
string spriteDirection = "D"
 
bool doDirections = true
 
bool crossfadeAnims = false
 
bool doDiagonals = false
 
AC_2DFrameFlipping frameFlipping = AC_2DFrameFlipping.None
 
bool flipCustomAnims = false
 
SpriteDirectionData _spriteDirectionData = null
 
AngleSnapping angleSnapping = AngleSnapping.None
 
float walkSpeedScale = 2f
 
float runSpeedScale = 6f
 
float reverseSpeedFactor = 1f
 
bool canRunInReverse = true
 
float turnSpeed = 7f
 
float acceleration = 6f
 
float deceleration = 0f
 
bool turnBeforeWalking = false
 
float runDistanceThreshold = 1f
 
bool antiGlideMode = false
 
bool retroPathfinding = false
 
bool ignoreGravity = false
 
bool freezeRigidbodyWhenIdle = false
 
bool useRigidbodyForMovement = true
 
bool useRigidbody2DForMovement = false
 
float simulatedMass = 1
 
float simulatedVerticalSpeed
 
bool doWallReduction = false
 
string wallLayer = "Default"
 
float wallDistance = 0.5f
 
bool wallReductionOnlyParameter = true
 
AudioClip walkSound
 
AudioClip runSound
 
AudioClip textScrollClip
 
Sound soundChild
 
AudioSource speechAudioSource
 
float headIKTurnFactor = 1f
 
float bodyIKTurnFactor = 0f
 
float eyesIKTurnFactor = 1f
 
Transform headTurnTarget
 
Vector3 headTurnTargetOffset
 
HeadFacing headFacing = HeadFacing.None
 
bool ikHeadTurning = false
 
float headTurnSpeed = 4f
 

Protected Member Functions

virtual void _Awake ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
void BaseUpdate ()
 
void PathUpdate ()
 
float GetTargetSpeed ()
 
void AccurateAcc (float targetSpeed, bool canStop)
 
virtual void Accelerate ()
 
void SetLastPath (Paths _lastPathActivePath, int _lastPathTargetNode, int _lastPathPrevNode)
 
void ReverseDirection ()
 
int GetLastTargetNode ()
 
int GetLastPrevNode ()
 
string GetSpriteDirectionToSave ()
 
void PrepareSpriteChild (bool isTopDown, bool isUnity2D)
 
void UpdateFrameFlipping (bool ignoreLockDirectionOption=false)
 
void UpdateSpriteChild (bool isTopDown, bool isUnity2D)
 
void UpdateScale ()
 
virtual bool CanBeDirectControlled ()
 

Protected Attributes

LerpUtils.FloatLerp moveSpeedLerp = new LerpUtils.FloatLerp ()
 
Quaternion newRotation
 
Transform _transform
 
Speech activeSpeech
 
float pathfindUpdateTime = 0f
 
bool isJumping = false
 
float turnFloat = 0f
 
Paths ownPath
 
AC_PathType lockedPathType
 
Rigidbody _rigidbody = null
 
Rigidbody2D _rigidbody2D = null
 
float originalGravityScale = 1f
 
Collider _collider = null
 
CharacterController _characterController
 
AudioSource audioSource
 
Paths activePath = null
 
float moveSpeed
 
Vector3 moveDirection
 
int targetNode = 0
 
bool pausePath = false
 
Vector3 lookDirection
 
int prevNode = 0
 
bool tankTurning = false
 
bool timelineHeadTurnOverride
 
Vector3 timelineHeadTurnTargetOffset
 
Transform timelineHeadTurnTarget
 
float timelineHeadTurnWeight
 

Properties

bool isRunning [get, set]
 
virtual bool IsPlayer [get]
 
float MoveSpeed [get]
 
Expression CurrentExpression [get]
 
bool AffectedByVerticalReduction [set]
 
Quaternion TransformRotation [get, set]
 
Vector3 TransformForward [get]
 
Vector3 TransformRight [get]
 
bool IsJumping [get]
 
SpriteDirectionData spriteDirectionData [get]
 
CharacterAnimationShot ActiveCharacterAnimationShot [get, set]
 
IKLimbController LeftHandIKController [get]
 
IKLimbController RightHandIKController [get]
 
Transform Transform [get, set]
 
bool isTalking [get]
 
float PathfindUpdateFrequency [get, set]
 

Detailed Description

The base class for both NPCs and the Player. It contains the functions needed for animation and movement.

Member Function Documentation

◆ _FixedUpdate()

virtual void AC.Char._FixedUpdate ( )
virtual

The character's "FixedUpdate" function, called by StateHandler.

Reimplemented in AC.Player.

◆ _LateUpdate()

virtual void AC.Char._LateUpdate ( )
virtual

The character's "LateUpdate" function, called by StateHandler.

Reimplemented in AC.Player.

◆ _Update()

virtual void AC.Char._Update ( )
virtual

The character's "Update" function, called by StateHandler.

Reimplemented in AC.Player, and AC.NPC.

◆ AccurateDestination()

bool AC.Char.AccurateDestination ( )

Checks if the character should attempt to be as accurate as possible when moving to a destination.

Returns
True if the character should attempt to be as accurate as possible when moving to a destination.

◆ CanTranslate()

bool AC.Char.CanTranslate ( int  index)

Checks if a given text index can and should be translated.

Parameters
indexThe index of the translatable text
Returns
True if the text can and should be translated

Implements AC.ITranslatable.

◆ ClearExpression()

void AC.Char.ClearExpression ( )

Clears the current Expression so that the default portrait icon is used.

◆ ClearHeadTurnTarget() [1/2]

void AC.Char.ClearHeadTurnTarget ( bool  isInstant)

Stops the head from facing a fixed point.

Parameters
isInstantIf True, the head will return to normal instantly

◆ ClearHeadTurnTarget() [2/2]

void AC.Char.ClearHeadTurnTarget ( bool  isInstant,
HeadFacing  _headFacing 
)

Ceases a particular type of head-facing.

Parameters
_headFacingThe type of head-facing to cease (Hotspot, Manual)
isInstantIf True, the head will return to normal instantly

◆ EndPath() [1/2]

virtual void AC.Char.EndPath ( )
virtual

Stops the character from moving along the current Paths object.

Reimplemented in AC.Player.

◆ EndPath() [2/2]

void AC.Char.EndPath ( Paths  optionalPath,
bool  stopTurningToo = true 
)

Stops the character from moving along the current Paths object.

Parameters
optionalPathIf set, the character will only stop if moving along this path

◆ FlattenSpriteAngle()

float AC.Char.FlattenSpriteAngle ( float  angle,
AngleSnapping  _angleSnapping 
)

Snaps a given angle to the nearest 90 or 45 degrees

Parameters
angleThe angle to snap
_angleSnappingThe neareset angle it should be snapped to (FortyFiveDegrees, NinetyDegrees)
Returns
The angle, snapped to the nearest 90 or 45 degrees

◆ ForceIdle()

void AC.Char.ForceIdle ( )

Forces the character into an idle state.

◆ ForgetLastPath()

void AC.Char.ForgetLastPath ( )

Clears the record of the character's last Paths object, so that they can no longer resume it

◆ GetAngleDifference()

float AC.Char.GetAngleDifference ( )

Gets the difference between the character's current facing angle, and the angle they wish to face.

Returns
The difference between the character's current facing angle, and the angle they wish to face.

◆ GetAnimation()

Animation AC.Char.GetAnimation ( )

Gets the character's Animation component.

Returns
The character's Animation component

◆ GetAnimator()

Animator AC.Char.GetAnimator ( )

Gets the character's Animator component. An Animator placed on the spriteChild GameObject will be given priority.

Returns
The character's Animator component

◆ GetAnimEngine()

AnimEngine AC.Char.GetAnimEngine ( )

Gets the character's AnimEngine ScriptableObject.

Returns
The character's AnimEngine ScriptableObject

◆ GetCurrentSpeech()

Speech AC.Char.GetCurrentSpeech ( )

Gets the character's current speech line

Returns
The character's current speech line

◆ GetExpressionID() [1/2]

int AC.Char.GetExpressionID ( )

Gets the ID number of the currently-active Expression.

Returns
The ID number of the currently-active Expression

◆ GetExpressionID() [2/2]

int AC.Char.GetExpressionID ( string  expressionLabel)

Gets the ID number of the Expression that has a specific label.

Parameters
expressionLabelThe label of the Expression to return the ID number of.
Returns
The ID number of the Expression if found, or -1 if not found

◆ GetFrameRotation()

Quaternion AC.Char.GetFrameRotation ( )

Gets the character's calculated rotation for this frame. This is not the same as GetTargetRotation, which is the 'final' rotation, but instead the rotation that a smoothly-rotated character should take.

Returns
The character's calculated rotation

◆ GetHandTransform()

Transform AC.Char.GetHandTransform ( Hand  hand)

Gets the Transform associated with a given hand bone

◆ GetHeadTurnTarget()

Vector3 AC.Char.GetHeadTurnTarget ( )

Gets the position of where the character's head is facing towards.

Returns
The position of where the character's head is facing towards, or Vector3.zero if their head is not facing anything.

◆ GetHeightChange()

float AC.Char.GetHeightChange ( )

Gets the character's change in height over the last frame.

Returns
The character's change in height over the last frame

◆ GetLastPath()

Paths AC.Char.GetLastPath ( )

Gets the last Path that the character was moving along

◆ GetLipSyncFrame()

int AC.Char.GetLipSyncFrame ( )

Gets the current lip-sync frame.

Returns
The current lip-sync frame

◆ GetLipSyncNormalised()

float AC.Char.GetLipSyncNormalised ( )

Gets the current lip-sync frame, as a fraction of the total number of phoneme frames.

Returns
The current lip-sync frame, as a fraction of the total number of phoneme frames

◆ GetMotionControl()

MotionControl AC.Char.GetMotionControl ( )

Gets the extent to which motion is controlled by the character script (Automatic, JustTurning, Manual).

Returns
The extent to which motion is controlled by the character script (Automatic, JustTurning, Manual).

◆ GetMoveDirection()

Vector3 AC.Char.GetMoveDirection ( )

Gets the direction that the character is moving in.

Returns
The direction that the character is moving in

◆ GetMoveSpeed()

float AC.Char.GetMoveSpeed ( bool  reduceNonFacing = false)

Gets the current movement speed.

Parameters
reduceNonFacingIf True, then movement speed will be reduced if the character is not facing their indented target.
Returns
The current movement speed

◆ GetName()

string AC.Char.GetName ( int  languageNumber = 0)

Gets the Character's current display name.

Parameters
languageNumberThe index number of the game's current language
Returns
The Character's current display name

◆ GetNumTranslatables()

int AC.Char.GetNumTranslatables ( )

Gets the maximum number of possible translatable texts.

Returns
The maximum number of possible translatable texts.

Implements AC.ITranslatable.

◆ GetOwner()

string AC.Char.GetOwner ( int  index)

Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.

Parameters
indexThe index of the translatable text
Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetPath()

Paths AC.Char.GetPath ( )

Gets the current Paths object that the character is moving along. If the character is pathfinding, the Paths component on the character's root will be returned.

Returns
The current Paths object that the character is moving along.

◆ GetPortrait()

CursorIconBase AC.Char.GetPortrait ( )

Gets the active portrait that's displayed in a MenuGraphic element when the character speaks. The portrait can change if an Expression has been defined.

◆ GetPortraitSprite()

Sprite AC.Char.GetPortraitSprite ( )

Gets a Sprite based on the portrait graphic of the character. If lipsincing is enabled, the sprite will be based on the current phoneme.

Returns
The character's portrait sprite

◆ GetPreviousNode()

int AC.Char.GetPreviousNode ( )

The last-reached node on the character's current path or Paths object

◆ GetShapeable()

Shapeable AC.Char.GetShapeable ( )

Gets the Shapeable script component attached to the GameObject's root or child.

Returns
The Shapeable script component attached to the GameObject's root or child.

◆ GetSpeechScreenPosition()

Vector2 AC.Char.GetSpeechScreenPosition ( bool  keepWithinScreen = true)

Gets the position of the top of the character, in screen-space.

Parameters
keepWithinScreenIf False, and the character is behind the camera, then the returned vector will be shifted far to the right in order to hide it
Returns
The position of the top of the character, in screen-space.

◆ GetSpeechWorldPosition()

Vector3 AC.Char.GetSpeechWorldPosition ( )

Gets the position of the top of the character, in world-space.

Returns
The position of the top of the character, in world-space.

◆ GetSpriteAngle()

float AC.Char.GetSpriteAngle ( )

Gets the angle that a 2D character's sprite is facing, relative to the root.

Returns
The angle that a 2D character's sprite is facing, relative to the root

◆ GetSpriteDirection()

string AC.Char.GetSpriteDirection ( bool  ignoreFrameFlipping = false)

Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR".

Returns
Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR".

◆ GetSpriteDirectionInt()

int AC.Char.GetSpriteDirectionInt ( bool  ignoreFrameFlipping = false)

Gets the direction that a 2D character is facing (Down = 0, Left = 1, Right = 2, Up = 3, DownLeft = 4, DownRight = 5, UpLeft = 6, UpRight = 7)

Returns
The direction that a 2D character is facing (Down = 0, Left = 1, Right = 2, Up = 3, DownLeft = 4, DownRight = 5, UpLeft = 6, UpRight = 7)

◆ GetTargetNode()

int AC.Char.GetTargetNode ( )

The next node to reach on the character's current path or Paths object

◆ GetTargetPosition()

Vector3 AC.Char.GetTargetPosition ( bool  wantFinalDestination = false)

Gets the character's destination when walking along a path.

Parameters
wantFinalDestinationIf True, the paths' end-point will be returned; otherwise, the current node target position will be returned.
Returns
The character's destination when walking along a path. If not moving along a path, the character's position will be returned.

◆ GetTargetRotation()

Quaternion AC.Char.GetTargetRotation ( )

Gets the character's target rotation.

Returns
The character's target rotation

◆ GetTargetSpeed()

float AC.Char.GetTargetSpeed ( )
protected

Stupid bug alert!

A check was made way back in v1.28 for a root Animator component because back then only Legacy and Mecanim animation was available (no 2D!). With this animation mode, the "move speed float" had to be tied directly to the walk/run speeds so that transitions could be properly built. This wasn't the right way to do this, of course, but the problem is now everyone's using this - so it can't be changed without having to get basically everyone working in 3D to update their movement values and transitions.

Since you can still achieve the same movement speeds as non-animator-on-root characters by lowering your movement values, all things considered it's probably best to just leave as is and say 'Yes I was stupid back then'! :/

◆ GetTranslatableString()

string AC.Char.GetTranslatableString ( int  index)

Gets the text to be translated, given its index.

Parameters
indexThe index of the translatable text
Returns
The text to be translated

Implements AC.ITranslatable.

◆ GetTranslationID()

int AC.Char.GetTranslationID ( int  index)

Gets the translation ID of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation ID of the text

Implements AC.ITranslatable.

◆ GetTranslationType()

AC_TextType AC.Char.GetTranslationType ( int  index)

Gets the translation type of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation type of a given text index.

Implements AC.ITranslatable.

◆ GetTurnFloat()

virtual float AC.Char.GetTurnFloat ( )
virtual

Gets the rate at which the character is turning (negative values used when turning anti-clockwise).

Returns
The rate at which the character is turning (negative values used when turninng anti-clockwise)

Reimplemented in AC.Player.

◆ Halt()

void AC.Char.Halt ( bool  haltTurning = true)

Stops the character moving.

Parameters
haltTurningIf True, turning will be halted too

◆ HasExistingTranslation()

bool AC.Char.HasExistingTranslation ( int  index)

Checks if a given text index has already been assigned a unique translation ID.

Parameters
indexThe index of the translatable text
Returns
True if the text has been assigned a unique translation ID

Implements AC.ITranslatable.

◆ HoldObject()

bool AC.Char.HoldObject ( GameObject  objectToHold,
Hand  hand 
)

Parents an object to the character's hand

Parameters
objectToHoldThe object to hold
handWhich hand to parent the object to (Left, Right)
Returns
True if the parenting was sucessful

◆ IsActivePlayer()

virtual bool AC.Char.IsActivePlayer ( )
virtual

Returns True if the character is the active Player.

Reimplemented in AC.Player.

◆ IsCapableOfJumping()

virtual bool AC.Char.IsCapableOfJumping ( )
virtual

True if the character is capable of jumping

Reimplemented in AC.Player.

◆ IsGrounded()

bool AC.Char.IsGrounded ( bool  reportError = false)

Checks if the character (if 3D) is in contact with the ground.

Parameters
reportErrorIf True, then an error message will be displayed if no means of detecting the ground can be found
Returns
True if the character (if 3D) is in contact with the ground

◆ IsMovingAlongPath()

bool AC.Char.IsMovingAlongPath ( )

Checks if the character is moving along a path.

Returns
True if the character is moving along a path

◆ IsMovingHead()

bool AC.Char.IsMovingHead ( )

Checks if the head is rotating to face its target, but has not yet reached it.

Returns
True if the head is rotating to face its target, but has not yet reached it.

◆ IsPathfinding()

bool AC.Char.IsPathfinding ( )

Checks if the character is currently pathfinding to a pre-determined destination

<returnsy>True if the character is currently pathfinding to a pre-determined destination

◆ IsReversing()

bool AC.Char.IsReversing ( )

Checks if the character is moving backwards.

Returns
True if the character is moving backwards

◆ IsTurning() [1/2]

bool AC.Char.IsTurning ( )

Checks if the character is turning.

Returns
True if the character is turning

◆ IsTurning() [2/2]

bool AC.Char.IsTurning ( float  maxAngleThreshold)

Checks if the character is turning.

Parameters
maxAngleThresholdThe maximum angle difference between the character's actual direction, and their intended direction, for a turn to be detected
Returns
True if the character is turning

◆ IsTurningBeforeWalking()

bool AC.Char.IsTurningBeforeWalking ( )

Checks if the character is spot-turning before making their move. isTurningBeforeWalking must be True for this to ever be the case.

Returns
True if the character is spot-turning before maing their move.

◆ LipSyncGameObject()

bool AC.Char.LipSyncGameObject ( )

Checks if the character is playing a lip-sync animation that affects the GameObject.

Returns
True if the character is playing a lip-sync animation that affects the GameObject

◆ MoveAlongPoints()

void AC.Char.MoveAlongPoints ( Vector3[]  pointData,
bool  run,
bool  allowUpdating = true 
)

Moves along a series of points in the scene.

Parameters
pointDataThe array of points to move along
runIf True, the character will run
allowUpdatingIf True, it will be recalculated over time according to SettingsManager's pathfindUpdateFrequency value

◆ MoveToPoint()

void AC.Char.MoveToPoint ( Vector3  point,
bool  run = false,
bool  usePathfinding = false 
)

Moves towards a point in the scene.

Parameters
pointThe point to move to
runIf True, the character will run
usePathfindingIf True, the character will pathfind using the scene's chosen navigation algorithm

◆ OnEnterTimeline()

void AC.Char.OnEnterTimeline ( PlayableDirector  director,
int  trackIndex 
)

Called whenever the character is bound to a Timeline track that's starting, and used to deactivate certain control components to allow them freedom.

Parameters
directorThe PlayableDirector that is playing the Timeline
trackIndexThe index number of the track within the director's TimelineAsset that the character appears on

◆ OnExitTimeline()

void AC.Char.OnExitTimeline ( PlayableDirector  director,
int  trackIndex 
)

Called whenever the character is bound to a Timeline track that's ending, and used to re-activate certain control components.

Parameters
directorThe PlayableDirector that is playing the Timeline
trackIndexThe index number of the track within the director's TimelineAsset that the character appears on

◆ OwnerIsPlayer()

bool AC.Char.OwnerIsPlayer ( int  index)

Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.

Parameters
indexThe index of the translatable text
Returns
True if the translatable text's owner is a Player.

Implements AC.ITranslatable.

◆ RecalculateActivePathfind()

void AC.Char.RecalculateActivePathfind ( )

Rebuilds the active pathfind.

◆ ReleaseHeldObject()

void AC.Char.ReleaseHeldObject ( Hand  hand,
bool  delete 
)

Drops any objects held in the character's hands.

◆ ReleaseHeldObjects()

void AC.Char.ReleaseHeldObjects ( bool  delete)

Drops any objects held in the character's hands.

◆ ReleaseSorting()

void AC.Char.ReleaseSorting ( )

Unlocks any FollowSortingMap that was locked to a sorting order/layer by SetSorting().

◆ ResetAnimator()

void AC.Char.ResetAnimator ( )

Resets the internal record of the character's Animator component, which will be re-assigned the next time GetAnimator() is called.

◆ ResetBaseClips()

void AC.Char.ResetBaseClips ( )

Removes all AnimationClips from the Animation component that are not "standard", e.g. Idle, Walk, Run and Talk.

◆ ResumeLastPath()

void AC.Char.ResumeLastPath ( )

Resumes moving along the character's last Paths object, if there was one.

◆ SetAnimEngine()

void AC.Char.SetAnimEngine ( AnimationEngine  _animationEngine,
string  customClassName = "" 
)

Sets the character's AnimEngine ScriptableObject.

Parameters
_animationEngineThe new AnimationEngine (Legacy, Mecanim, SpritesUnity, SpritesUnityComplex, Sprites2DToolkit)
customClassNameThe name of the ScriptableObject class to rely on for animation, if _animationEngine = AnimationEngine.Custom

◆ SetExpression() [1/2]

void AC.Char.SetExpression ( int  ID)

Changes the active Expression.

Parameters
IDThe ID number of the Expression, in expressions, to make active.

◆ SetExpression() [2/2]

void AC.Char.SetExpression ( string  _name)

Changes the active Expression.

Parameters
_nameThe name of the Expression, in expressions, to make active.

◆ SetHeadTurnTarget()

virtual void AC.Char.SetHeadTurnTarget ( Transform  _headTurnTarget,
Vector3  _headTurnTargetOffset,
bool  isInstant,
HeadFacing  _headFacing = HeadFacing.Manual 
)
virtual

Controls the head-facing position.

Parameters
_headTurnTargetThe Transform to face
_headTurnTargetOffsetThe position offset of the Transform
isInstantIf True, the head will turn instantly
_headFacingWhat the head should face (Manual, Hotspot, None)

Reimplemented in AC.Player.

◆ SetLookDirection()

void AC.Char.SetLookDirection ( Vector3  _direction,
bool  isInstant 
)

Sets the intended direction to face.

Parameters
_directionThe relative direction to face
isInstantIf True, the Player will instantly turn to face the direction

◆ SetMoveDirection()

void AC.Char.SetMoveDirection ( Vector3  _direction,
bool  useSmoothing = false 
)

Moves the character in a particular direction.

Parameters
_directionThe direction to move in
useSmoothingIf True, smoothing will be applied to the change in direction, so the change will be gradual

◆ SetMoveDirectionAsBackward()

void AC.Char.SetMoveDirectionAsBackward ( )

Moves the character backward.

◆ SetMoveDirectionAsForward()

void AC.Char.SetMoveDirectionAsForward ( )

Moves the character forward.

◆ SetName()

void AC.Char.SetName ( string  newName,
int  _lineID 
)

Renames the Character mid-game.

Parameters
newNameThe new name of the character
_lineIDThe translation ID number assocated with the new name, as set by SpeechManager

◆ SetPath() [1/4]

void AC.Char.SetPath ( Paths  pathOb)

Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined.

Parameters
pathObThe Paths object to move along

◆ SetPath() [2/4]

void AC.Char.SetPath ( Paths  pathOb,
int  _targetNode,
int  _prevNode 
)

Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined.

Parameters
pathObThe Paths object to move along
_targetNodeThe index number of the first node to move to
_prevNodeThe index number of the node moving away from

◆ SetPath() [3/4]

void AC.Char.SetPath ( Paths  pathOb,
int  _targetNode,
int  _prevNode,
bool  affectY 
)

Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined.

Parameters
pathObThe Paths object to move along
_targetNodeThe index number of the first node to move to
_prevNodeThe index number of the node moving away from
affectYIf True, then the character will account for the "Y" position of nodes

◆ SetPath() [4/4]

void AC.Char.SetPath ( Paths  pathOb,
PathSpeed  _speed 
)

Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined.

Parameters
pathObThe Paths object to move along
_speedThe speed to move along the path (Walk, Run)

◆ SetRotation() [1/2]

void AC.Char.SetRotation ( float  angle)

Instantly rotates the Player

Parameters
angleThe angle, in degrees, around the Y-axis to rotate to

◆ SetRotation() [2/2]

void AC.Char.SetRotation ( Quaternion  _rotation)

Instantly rotates the character

Parameters
_rotationThe new rotation

◆ SetSorting() [1/2]

void AC.Char.SetSorting ( int  order)

Locks the Renderer's sortingOrder.

Parameters
orderThe sorting order to lock the Renderer to

◆ SetSorting() [2/2]

void AC.Char.SetSorting ( string  layer)

Locks the Renderer's sorting layer.

Parameters
layerThe sorting layer to lock the Renderer to

◆ SetSpeechVolume()

void AC.Char.SetSpeechVolume ( float  volume)

Updates the volume level of the Character's speech audio.

Parameters
volumeThe new volume level

◆ SetSpriteDirection()

void AC.Char.SetSpriteDirection ( CharDirection  direction)

Locks a 2D character's sprite to face a particular direction.

Parameters
directionThe direction to face (Down, Left, Right, Up, DownLeft, DownRight, UpLeft, UpRight)

◆ SetTranslationID()

void AC.Char.SetTranslationID ( int  index,
int  lineID 
)

Sets the translation ID of a given text index

Parameters
indexThe index of the translatable text
lineIDThe new translation ID to assign the translatable text

Implements AC.ITranslatable.

◆ SnapHeadMovement()

void AC.Char.SnapHeadMovement ( )

Snaps the head so that it faces the fixed point it's been told to, instead of rotating towards it over time.

◆ StartDecelerating()

void AC.Char.StartDecelerating ( )

Causes the character to slow down and stop moving.

◆ StartLipSync()

void AC.Char.StartLipSync ( List< LipSyncShape _lipSyncShapes)

Begins a lip-syncing animation based on a series of LipSyncShapes.

Parameters
_lipSyncShapesThe LipSyncShapes to use as the basis for the animation

◆ StopSpeaking()

void AC.Char.StopSpeaking ( )

Stops the character speaking. This is for animation and audio only - to stop the Speech class from running, call the Dialog script's EndSpeechByCharacter method.

◆ StopTurning()

void AC.Char.StopTurning ( )

Instantly stops the character turning.

◆ Teleport()

void AC.Char.Teleport ( Vector3  _position,
bool  recalculateActivePathFind = false 
)

Teleports the character. The message 'OnTeleport' will be sent to the character's GameObject after the position is set.

Parameters
_positionThe point to teleport to
recalculateActivePathFindIf True and the character is walking, then their navigation path will be recalculated to account for the position change

◆ WillStopAtNextNode()

bool AC.Char.WillStopAtNextNode ( )

Checks if the character is pathfinding, and the next node on the path will be their intended destination

Returns
True if the character is pathfinding, and the next node on the path will be their intended destination

Member Data Documentation

◆ _spriteDirectionData

SpriteDirectionData AC.Char._spriteDirectionData = null

The direction settings, if using sprite-based characters

◆ acceleration

float AC.Char.acceleration = 6f

The acceleration factor

◆ angleParameter

string AC.Char.angleParameter = "Angle"

The name of the Animator float parameter set to the facing angle, if using AnimEngine_SpritesUnityComplex

◆ angleSnapping

AngleSnapping AC.Char.angleSnapping = AngleSnapping.None

If using Sprites Unity Complex to animate the character, then the 'Body angle float' and 'Head angle float' parameters will be snapped according to this value

◆ animationEngine

AnimationEngine AC.Char.animationEngine = AnimationEngine.SpritesUnity

The animation engine enum (SpritesUnity, SpritesUnityComplex, Sprites2DToolkit, Legacy, Mecanim, Custom)

◆ animCrossfadeSpeed

float AC.Char.animCrossfadeSpeed = 0.2f

The default duration, in seconds, when crossfading standard animations, if using AnimEngine_Legacy

◆ antiGlideMode

bool AC.Char.antiGlideMode = false

If True, then sprite-based characters will only move when their sprite frame changes

◆ bodyIKTurnFactor

float AC.Char.bodyIKTurnFactor = 0f

The amount that the body is influenced by IK head-turning.

◆ canRunInReverse

bool AC.Char.canRunInReverse = true

If True, it is possible to run backwards (Tank Controls / First Person only)

◆ charState

CharState AC.Char.charState

The character's state (Idle, Move, Decelarate, Custom)

◆ crossfadeAnims

bool AC.Char.crossfadeAnims = false

If True, characters will crossfade between standard animations, if using AnimEngine_SpritesUnity

◆ customAnimationClass

string AC.Char.customAnimationClass = ""

The class name of the AnimEngine ScriptableObject that animates the character, if animationEngine = AnimationEngine.Custom

◆ customAnimator

Animator AC.Char.customAnimator

The Animator component, which will be assigned automatically if not set manually

◆ deceleration

float AC.Char.deceleration = 0f

The deceleration factor

◆ directionParameter

string AC.Char.directionParameter = "Direction"

The name of the Animator integer parameter set to the sprite direction (set by GetSpriteDirectionInt()), if using AnimEngine_SpritesUnityComplex

◆ displayLineID

int AC.Char.displayLineID = -1

The translation ID number of the Hotspot's name, if it was changed mid-game

◆ doDiagonals

bool AC.Char.doDiagonals = false

(DEPRECATED - Use spriteDirectionData instead)

◆ doDirections

bool AC.Char.doDirections = true

(DEPRECATED - Use spriteDirectionData instead)

◆ doWallReduction

bool AC.Char.doWallReduction = false

If True, then characters will slow down when walking into walls, if using AnimEngine_Mecanim or AnimEngine_SpritesUnityComplex

◆ expressionGroupID

int AC.Char.expressionGroupID

The Shapeable group ID that controls expression blendshapes, if using AnimEngine_Legacy / AnimEngine_Mecanim

◆ expressionParameter

string AC.Char.expressionParameter = ""

The name of the Animator integer parameter set to the active Expression ID number

◆ expressions

List<Expression> AC.Char.expressions = new List<Expression> ()

The character's available expressions, if useExpressions = True

◆ expressionTransitionTime

float AC.Char.expressionTransitionTime = 0.2f

The transition time when changing expressions via shapekey

◆ eyesIKTurnFactor

float AC.Char.eyesIKTurnFactor = 1f

The amount that the eyes are influenced by IK head-turning.

◆ flipCustomAnims

bool AC.Char.flipCustomAnims = false

If True, and frameFlipping != AC_2DFrameFlipping.None, then custom animations will also be flipped

◆ frameFlipping

AC_2DFrameFlipping AC.Char.frameFlipping = AC_2DFrameFlipping.None

The type of frame-flipping to use on sprite-based characters (None, LeftMirrorsRight, RightMirrorsLeft)

◆ freezeRigidbodyWhenIdle

bool AC.Char.freezeRigidbodyWhenIdle = false

If True, the character's Rigidbody will be frozen in place when idle. This is to help slipping when on sloped surfaces

◆ groundCheckLayerMask

int AC.Char.groundCheckLayerMask = 1

The layermask to use when Raycasting to determine if the character is grounded or not

◆ headFacing

HeadFacing AC.Char.headFacing = HeadFacing.None

The type of head-turning effect that is currently active (None, Hotspot, Manual)

◆ headIKTurnFactor

float AC.Char.headIKTurnFactor = 1f

The amount that the head is influenced by IK head-turning. Normally this should be left as 1, but may need reducing if the neck is made of multiple bones.

◆ headLayer

int AC.Char.headLayer = 1

The Animator layer used to play head animations while talking, by AnimEngine_Mecanim / AnimEngine_SpritesUnity

◆ headLookDownAnim

AnimationClip AC.Char.headLookDownAnim

The "Look down" animation, if using AnimEngine_Legacy

◆ headLookLeftAnim

AnimationClip AC.Char.headLookLeftAnim

The "Look left" animation, if using AnimEngine_Legacy

◆ headLookRightAnim

AnimationClip AC.Char.headLookRightAnim

The "Look right" animation, if using AnimEngine_Legacy

◆ headLookUpAnim

AnimationClip AC.Char.headLookUpAnim

The "Look up" animation, if using AnimEngine_Legacy

◆ headPitchParameter

string AC.Char.headPitchParameter = ""

The name of the Animator float parameter set to the head pitch, if using AnimEngine_Mecanim

◆ headTurnSpeed

float AC.Char.headTurnSpeed = 4f

The speed of head-turning

◆ headTurnTarget

Transform AC.Char.headTurnTarget

The Transform that the character is turning its head towards, if headFacing != HeadFacing.None

◆ headTurnTargetOffset

Vector3 AC.Char.headTurnTargetOffset

The offset point in World Space that the character is turning its head towards, if headFacing != HeadFacing.None

◆ headYawParameter

string AC.Char.headYawParameter = ""

The name of the Animator float parameter set to the head yaw, if using AnimEngine_Mecanim

◆ idleAnim

AnimationClip AC.Char.idleAnim

The "Idle" animation, if using AnimEngine_Legacy

◆ idleAnimSprite

string AC.Char.idleAnimSprite = "idle"

The name of the 'Idle' animation(s), without suffix, used by AnimEngine_SpritesUnity

◆ ignoreGravity

bool AC.Char.ignoreGravity = false

If True, the character will ignore the effects of gravity

◆ ikHeadTurning

bool AC.Char.ikHeadTurning = false

If True, then inverse-kinematics will be used to turn the character's head dynamically, rather than playing pre-made animations

◆ isGroundedParameter

string AC.Char.isGroundedParameter

The name of the Animator bool parameter set to the 'Is Grounded' check, is using AnimEngine_Mecanim

◆ isLipSyncing

bool AC.Char.isLipSyncing = false

If True, the character is currently lip-syncing

◆ jumpParameter

string AC.Char.jumpParameter = ""

The name of the Animator boolean parameter to set to 'True' when jumping, if using Mecanim animation (Player characters only)

◆ leftArmBone

Transform AC.Char.leftArmBone

The "Left arm" bone Transform, used to isolate animations if using AnimEngine_Legacy

◆ leftHandBone

Transform AC.Char.leftHandBone

The Transform to parent objects held in the character's left hand to

◆ lineID

int AC.Char.lineID = -1

The translation ID number of the Character's name, as generated by SpeechManager

◆ lipSyncBlendShapeSpeedFactor

float AC.Char.lipSyncBlendShapeSpeedFactor = 1f

A speed tfactor to apply to the changing of blend-shapes based on lipsyncing

◆ lipSyncGroupID

int AC.Char.lipSyncGroupID

The Shapeable group ID that controls phoneme blendshapes, if using AnimEngine_Legacy / AnimEngine_Mecanim

◆ lockDirection

bool AC.Char.lockDirection = false

If True, sprite-based characters will be locked to face a set direction

◆ lockScale

bool AC.Char.lockScale = false

If True, sprite-based characters will not resize along a SortingMap

◆ mapExpressionsToShapeable

bool AC.Char.mapExpressionsToShapeable = false

If useExpressions = True, and the chosen animation engine allows for it, a Shapeable component can be mapped to expressions to allow for expression tokens to control blendshapes

◆ motionControl

MotionControl AC.Char.motionControl = MotionControl.Automatic

How motion is controlled, if animationEngine = AnimationEngine.Custom (Automatic, JustTurning, Manual)

◆ mouthLayer

int AC.Char.mouthLayer = 2

The Animator layer used to play mouth animations while talking, by AnimEngine_Mecanim / AnimEngine_SpritesUnity

◆ moveSpeedParameter

string AC.Char.moveSpeedParameter = "Speed"

The name of the Animator float parameter set to the movement speed, if using AnimEngine_Mecanim

◆ neckBone

Transform AC.Char.neckBone

The "Neck" bone Transform, used to isolate animations if using AnimEngine_Legacy

◆ phonemeNormalisedParameter

string AC.Char.phonemeNormalisedParameter = ""

The name of the Animator float parameter set to the lip-syncing phoneme index, relative to the total number of phonemes

◆ phonemeParameter

string AC.Char.phonemeParameter = ""

The name of the Animator integer parameter set to the lip-syncing phoneme index, if using AnimEngine_SpritesUnityComplex

◆ portraitIcon

CursorIconBase AC.Char.portraitIcon = new CursorIconBase ()

The character's portrait graphic, used in MenuGraphic elements when speaking

◆ retroPathfinding

bool AC.Char.retroPathfinding = false

Enables 'retro-style' movement when pathfinding, where characters ignore Acceleration and Deceleration values, and turn instantly when moving

◆ reverseSpeedFactor

float AC.Char.reverseSpeedFactor = 1f

The factor by which speed is reduced when reversing (Tank Controls / First Person only)

◆ rightArmBone

Transform AC.Char.rightArmBone

The "Right arm" bone Transform, used to isolate animations if using AnimEngine_Legacy

◆ rightHandBone

Transform AC.Char.rightHandBone

The Transform to parent objects held in the character's right hand to

◆ rootTurningFactor

float AC.Char.rootTurningFactor = 0f

The factor by which the job of turning is left to Mecanim root motion, if using AnimEngine_Mecanim

◆ rotateSprite3D

RotateSprite3D AC.Char.rotateSprite3D = RotateSprite3D.CameraFacingDirection

The method by which a sprite-based character should face the camera in 3D games (CameraRotation, CameraPosition)

◆ runAnim

AnimationClip AC.Char.runAnim

The "Run" animation, if using AnimEngine_Legacy

◆ runAnimSprite

string AC.Char.runAnimSprite = "run"

The name of the 'Run' animation(s), without suffix, used by AnimEngine_SpritesUnity

◆ runDistanceThreshold

float AC.Char.runDistanceThreshold = 1f

The minimum distance between the character and its destination for running to be possible

◆ runSound

AudioClip AC.Char.runSound

The sound to play when running

◆ runSpeedScale

float AC.Char.runSpeedScale = 6f

The movement speed when running

◆ separateTalkingLayer

bool AC.Char.separateTalkingLayer = false

If True, using SpritesUnity animation, and talkingAnimation = TalkingAnimation.Standard, then the head animation (talking) will be handled on a non-root layer.

◆ simulatedMass

float AC.Char.simulatedMass = 1

The character's simulated mass, if using a Character Controller

◆ soundChild

Sound AC.Char.soundChild

The Sound child to play all non-speech AudioClips on. Speech AudioClips will be placed on the root GameObject

◆ speechAudioSource

AudioSource AC.Char.speechAudioSource

The AudioSource from which to play speech audio

◆ speechColor

Color AC.Char.speechColor = Color.white

The colour of the character's speech text

◆ speechLabel

string AC.Char.speechLabel = ""

The character's display name when speaking

◆ speechMenuPlacement

Transform AC.Char.speechMenuPlacement

The Transform at which to place Menus set to appear 'Above Speaking Character'. If this is not set, the placement will be set automatically.

◆ spriteChild

Transform AC.Char.spriteChild

The sprite Transform, that's a child GameObject, used by AnimEngine_SpritesUnity / AnimEngine_SpritesUnityComplex / AnimEngine_Sprites2DToolkit

◆ spriteDirection

string AC.Char.spriteDirection = "D"

The directional suffix to face (e.g. "L" for "Left"), if lockDirection = True

◆ spriteScale

float AC.Char.spriteScale = 1f

A sprite-based character's scale, if lockScale = True

◆ talkAnim

AnimationClip AC.Char.talkAnim

The "Talk" animation, if using AnimEngine_Legacy

◆ talkAnimSprite

string AC.Char.talkAnimSprite = "talk"

The name of the 'Talk' animation(s), without suffix, used by AnimEngine_SpritesUnity

◆ talkingAnimation

TalkingAnimation AC.Char.talkingAnimation = TalkingAnimation.Standard

How talking animations are handled (Standard, CustomFace)

◆ talkParameter

string AC.Char.talkParameter = "IsTalking"

The name of the Animator bool parameter set to True while talking, if using AnimEngine_Mecanim

◆ textScrollClip

AudioClip AC.Char.textScrollClip

The sound to play when the character's speech text is scrolling

◆ turn2DCharactersIn3DSpace

bool AC.Char.turn2DCharactersIn3DSpace = true

If True, then the root object of a 2D, sprite-based character will rotate around the Z-axis. Otherwise, turning will be simulated and the actual rotation will be unaffected

◆ turnBeforeWalking

bool AC.Char.turnBeforeWalking = false

If True, the character will turn on the spot to face their destination before moving

◆ turningAngleThreshold

float AC.Char.turningAngleThreshold = 4f

The minimum angle between the character's current direction, and their intended direction, for spot-turning to be possible

◆ turnLeftAnim

AnimationClip AC.Char.turnLeftAnim

The "Turn left" animation, if using AnimEngine_Legacy

◆ turnParameter

string AC.Char.turnParameter = ""

The name of the Animator float parameter set to the turning direction, if using AnimEngine_Mecanim

◆ turnRightAnim

AnimationClip AC.Char.turnRightAnim

The "Turn right" animation, if using AnimEngine_Legacy

◆ turnSpeed

float AC.Char.turnSpeed = 7f

The turn speed

◆ upperBodyBone

Transform AC.Char.upperBodyBone

The "Upper body" bone Transform, used to isolate animations if using AnimEngine_Legacy

◆ useExpressions

bool AC.Char.useExpressions

If True, speech text can use expression tokens to change the character's expression

◆ useRigidbody2DForMovement

bool AC.Char.useRigidbody2DForMovement = false

If True, and the character has a Rigidbody2D component, then it will be moved by adding forces in FixedUpdate, as opposed to the transform being manipulated in Update

◆ useRigidbodyForMovement

bool AC.Char.useRigidbodyForMovement = true

If True, and the character has a Rigidbody component, then it will be moved by adding forces in FixedUpdate, as opposed to the transform being manipulated in Update

◆ verticalMovementParameter

string AC.Char.verticalMovementParameter = ""

The name of the Animator float parameter set to the vertical movement speed, if using AnimEngine_Mecanim

◆ walkAnim

AnimationClip AC.Char.walkAnim

The "Walk" animation, if using AnimEngine_Legacy

◆ walkAnimSprite

string AC.Char.walkAnimSprite = "walk"

The name of the 'Walk' animation(s), without suffix, used by AnimEngine_SpritesUnity

◆ walkSound

AudioClip AC.Char.walkSound

The sound to play when walking

◆ walkSpeedScale

float AC.Char.walkSpeedScale = 2f

The movement speed when walking

◆ wallDistance

float AC.Char.wallDistance = 0.5f

The distance to keep away from walls, if doWallReduction = True

◆ wallLayer

string AC.Char.wallLayer = "Default"

The layer that walls are expected to be placed on, if doWallReduction = True

◆ wallReductionOnlyParameter

bool AC.Char.wallReductionOnlyParameter = true

If True, and doWallReduction = True, then the wall reduction factor will only affect the Animator move speed float parameter, and not character's actual speed

Property Documentation

◆ ActiveCharacterAnimationShot

CharacterAnimationShot AC.Char.ActiveCharacterAnimationShot
getset

The CharacterAnimationShot that's currently being applied to the character, if sprite-based

◆ AffectedByVerticalReduction

bool AC.Char.AffectedByVerticalReduction
set

If set to False, the character's vertical speed will not be affected by the scene's 'Vertical reduction factor'

◆ CurrentExpression

Expression AC.Char.CurrentExpression
get

The character's current Expression

◆ IsJumping

bool AC.Char.IsJumping
get

If True, then the character is mid-jump

◆ IsPlayer

virtual bool AC.Char.IsPlayer
get

Returns True if the character is a Player, even if they are not the current active Player.

◆ isRunning

bool AC.Char.isRunning
getset

If True, the character will run when moving

◆ isTalking

bool AC.Char.isTalking
get

Checks if the character is currently speaking

◆ PathfindUpdateFrequency

float AC.Char.PathfindUpdateFrequency
getset

The time (in seconds) to take to recalculate pathfinding. If 0, pathfind updating is disabled, if negative, the Settings Manager's pathfindUpdateFrequence is used instead

◆ spriteDirectionData

SpriteDirectionData AC.Char.spriteDirectionData
get

Data related to what directions the character can face, if sprite-based

◆ Transform

Transform AC.Char.Transform
getset

A cache of the character's root transform component

◆ TransformForward

Vector3 AC.Char.TransformForward
get

The character's forward vector. This is normally the transform.forward, but if the character is sprite-based and turn2DCharactersIn3DSpace = False, then this is a 'dummy' forward instead.

◆ TransformRight

Vector3 AC.Char.TransformRight
get

The character's right vector. This is normally the transform.right, but if the character is sprite-based and turn2DCharactersIn3DSpace = False, then this is a 'dummy' forward instead.

◆ TransformRotation

Quaternion AC.Char.TransformRotation
getset

The character's rotation. This is normally the transform.rotation, but if the character is sprite-based and turn2DCharactersIn3DSpace = False, then this is a 'dummy' rotation instead.