Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.Player Class Reference
Inheritance diagram for AC.Player:
AC.NPC AC.Char AC.ITranslatable

Public Member Functions

override void _Update ()
override void _LateUpdate ()
override void _FixedUpdate ()
void TankTurnLeft (float intensity=1f)
 Makes the Player spot-turn left during gameplay. This needs to be called every frame of the turn.
void TankTurnRight (float intensity=1f)
 Makes the Player spot-turn right during gameplay. This needs to be called every frame of the turn.
void CancelPathfindRecalculations ()
override void StopTankTurning ()
override float GetTurnFloat ()
 Gets the rate at which the character is turning (negative values used when turning anti-clockwise).
void ForceTurnFloat (float _value)
override bool IsCapableOfJumping ()
bool Jump (bool mustBeGrounded=true, bool mustNotBeMidJump=true)
 Causes the Player to jump, so long as a Rigidbody or Character Controller component is attached.
override void EndPath ()
void ReverseDirectPathDirection ()
void SetLockedPath (Paths pathOb, bool canReverse=false, PathSnapping pathSnapping=PathSnapping.SnapToStart, int startingNode=0)
 Locks the Player to a Paths object during gameplay, if using Direct movement. This allows the designer to constrain the Player's movement to a Path, even though they can move freely along it.
bool IsLockedToPath ()
 Checks if the Player is constrained to move along a Paths object during gameplay.
bool AllDirectionsLocked ()
 Checks if the Player is prevented from being moved directly in all four directions.
bool IsTilting ()
float GetTilt ()
void SetTilt (Vector3 lookAtPosition, bool isInstant)
 Sets the tilt of a first-person camera.
void SetTilt (float pitchAngle, bool isInstant)
 Sets the tilt of a first-person camera.
override void SetHeadTurnTarget (Transform _headTurnTarget, Vector3 _headTurnTargetOffset, bool isInstant, HeadFacing _headFacing=HeadFacing.Manual)
 Controls the head-facing position.
PlayerData SaveData (PlayerData playerData)
 Updates a PlayerData class with its own variables that need saving.
bool IsLocalPlayer ()
 Checks if the player is local to the scene, and not from a prefab.
IEnumerator LoadData (PlayerData playerData)
 Updates its own variables from a PlayerData class.
virtual void Hide ()
virtual void Show ()
void RemoveFromScene (bool immediately=false)
bool IsFollowingActivePlayerAcrossScenes ()
override string ToString ()
override bool IsActivePlayer ()
IEnumerator SetID (int value)
Public Member Functions inherited from AC.NPC
void StopFollowing ()
void FollowAssign (Char _followTarget, bool _followTargetIsPlayer, float _followFrequency, float _followDistance, float _followDistanceMax, bool _faceWhenIdle=false, bool _followRandomDirection=true, bool _followAcrossScenes=false)
 Assigns a new target (NPC or Player) to start following.
NPCData SaveData (NPCData npcData)
 Updates a NPCData class with its own variables that need saving.
void LoadData (NPCData data)
 Updates its own variables from a NPCData class.
AC.Char GetFollowTarget ()
 Gets the character that the NPC is currently following, if any.
void HideFromView (Player player=null)
 Moves the NPC out of the view by basically teleporting them very far away.
override string ToString ()
void Convert ()
Public Member Functions inherited from AC.Char
void Upgrade ()
void RecalculateActivePathfind ()
bool AccurateDestination ()
 Checks if the character should attempt to be as accurate as possible when moving to a destination.
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.
void SetRotation (Quaternion _rotation)
 Instantly rotates the character.
void SetRotation (float angle)
 Instantly rotates the Player.
void StopTurning ()
float GetAngleDifference ()
 Gets the difference between the character's current facing angle, and the angle they wish to face.
void SetLookDirection (Vector3 _direction, bool isInstant)
 Sets the intended direction to face.
void SetMoveDirection (Vector3 _direction, bool useSmoothing=false, bool flatten3D=true)
 Moves the character in a particular direction.
void SetMoveDirectionAsForward ()
void SetMoveDirectionAsBackward ()
Animation GetAnimation ()
 Gets the character's Animation component.
Animator GetAnimator ()
 Gets the character's Animator component. An Animator placed on the spriteChild GameObject will be given priority.
void ResetAnimator ()
Vector3 GetMoveDirection ()
 Gets the direction that the character is moving in.
bool WillStopAtNextNode ()
 Checks if the character is pathfinding, and the next node on the path will be their intended destination.
bool IsPathfinding ()
 Checks if the character is currently pathfinding to a pre-determined destination.
void EndPath (Paths optionalPath, bool stopTurningToo=true)
 Stops the character from moving along the current Paths object.
void StartDecelerating ()
void ResumeLastPath ()
void ForgetLastPath ()
void Halt (bool haltTurning=true)
 Stops the character moving.
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.
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.
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.
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.
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.
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.
int GetTargetNode ()
int GetPreviousNode ()
Paths GetLastPath ()
void MoveToPoint (Vector3 point, bool run=false, bool usePathfinding=false)
 Moves towards a point in the scene.
void MoveAlongPoints (Vector3[] pointData, bool run, bool allowUpdating=true)
 Moves along a series of points in the scene.
void ResetBaseClips ()
float GetSpriteAngle ()
 Gets the angle that a 2D character's sprite is facing, relative to the root.
string GetSpriteDirection (bool ignoreFrameFlipping=false)
 Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR".
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)
void SetSpriteDirection (CharDirection direction)
 Locks a 2D character's sprite to face a particular direction.
void ResetAnimationEngine ()
float FlattenSpriteAngle (float angle, AngleSnapping _angleSnapping)
 Snaps a given angle to the nearest 90 or 45 degrees.
void SetSorting (int order)
 Locks the Renderer's sortingOrder.
void SetSorting (string layer)
 Locks the Renderer's sorting layer.
void ReleaseSorting ()
float GetMoveSpeed (bool reduceNonFacing=false)
 Gets the current movement speed.
void ClearHeadTurnTarget (bool isInstant, HeadFacing _headFacing)
 Ceases a particular type of head-facing.
void ClearHeadTurnTarget (bool isInstant)
 Stops the head from facing a fixed point.
void SnapHeadMovement ()
bool IsMovingHead ()
 Checks if the head is rotating to face its target, but has not yet reached it.
Shapeable GetShapeable ()
 Gets the Shapeable script component attached to the GameObject's root or child.
Vector3 GetHeadTurnTarget ()
 Gets the position of where the character's head is facing towards.
Transform GetHandTransform (int attachmentPointID)
bool HoldObject (GameObject objectToHold, int attachmentPointID)
 Parents an object to the character's hand.
void ReleaseHeldObjects (bool delete)
GameObject ReleaseHeldObject (int attachmentPointID, bool delete)
 Drops any objects held in the character's hands.
Vector3 GetSpeechWorldPosition ()
 Gets the position of the top of the character, in world-space.
Vector2 GetSpeechScreenPosition (bool keepWithinScreen=true)
 Gets the position of the top of the character, in screen-space.
void StartLipSync (List< LipSyncShape > _lipSyncShapes)
 Begins a lip-syncing animation based on a series of LipSyncShapes.
int GetLipSyncFrame ()
 Gets the current lip-sync frame.
float GetLipSyncNormalised ()
 Gets the current lip-sync frame, as a fraction of the total number of phoneme frames.
bool LipSyncGameObject ()
 Checks if the character is playing a lip-sync animation that affects the GameObject.
void StopSpeaking ()
int GetExpressionID (string expressionLabel)
 Gets the ID number of the Expression that has a specific label.
int GetExpressionID ()
 Gets the ID number of the currently-active Expression.
void ClearExpression ()
 Clears the current Expression so that the default portrait icon is used.
void SetExpression (int ID)
 Changes the active Expression.
void SetExpression (string _name)
 Changes the active Expression.
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.
bool IsGrounded (bool reportError=false)
 Checks if the character (if 3D) is in contact with the ground.
MotionControl GetMotionControl ()
 Gets the extent to which motion is controlled by the character script (Automatic, JustTurning, Manual).
Vector3 GetTargetPosition (bool wantFinalDestination=false)
 Gets the character's destination when walking along a path.
Quaternion GetTargetRotation ()
 Gets the character's target rotation.
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.
AnimEngine GetAnimEngine ()
 Gets the character's AnimEngine ScriptableObject.
void SetAnimEngine (AnimationEngine _animationEngine, string customClassName="")
 Sets the character's AnimEngine ScriptableObject.
float GetHeightChange ()
 Gets the character's change in height over the last frame.
bool IsReversing ()
 Checks if the character is moving backwards.
bool IsTurning ()
 Checks if the character is turning.
bool IsTurning (float maxAngleThreshold)
 Checks if the character is turning.
bool IsMovingAlongPath ()
 Checks if the character is moving along a path.
string GetName (int languageNumber=0)
 Gets the Character's current display name.
void SetName (string newName, int _lineID)
 Renames the Character mid-game.
void SetSpeechVolume (float volume)
 Updates the volume level of the Character's speech audio.
Speech GetCurrentSpeech ()
 Gets the character's current speech line.
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.
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.
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.
string GetTranslatableString (int index)
 Gets the text to be translated, given its index.
int GetTranslationID (int index)
 Gets the translation ID of a given text index.
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index.
void UpdateTranslatableString (int index, string updatedText)
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts.
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID.
void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index.
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.
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.
bool CanTranslate (int index)
 Checks if a given text index can and should be translated.
void SetTimelineHeadTurnOverride (Transform _timelineHeadTurnTarget, Vector3 _timelineHeadTurnTargetOffset, float _timelineHeadTurnWeight)
void ReleaseTimelineHeadTurnOverride ()

Public Attributes

AnimationClip jumpAnim
DetectHotspots hotspotDetector
bool toggleRun
bool autoSyncHotspotState = true
float jumpSpeed = 4f
PlayerMoveLock runningLocked = PlayerMoveLock.Free
bool upMovementLocked = false
bool downMovementLocked = false
bool leftMovementLocked = false
bool rightMovementLocked = false
bool freeAimLocked = false
bool jumpingLocked = false
Public Attributes inherited from AC.NPC
bool moveOutOfPlayersWay = false
float minPlayerDistance = 1f
Public Attributes inherited from AC.Char
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
AttachmentPoint[] attachmentPoints = new AttachmentPoint[0]
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 = false
Transform spriteChild
RotateSprite3D rotateSprite3D = RotateSprite3D.CameraFacingDirection
string idleAnimSprite = "idle"
string walkAnimSprite = "walk"
string runAnimSprite
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 textScrollClip
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

new void Awake ()
override void OnEnable ()
override void OnDisable ()
void SnapToNavMesh2D ()
override bool CanBeDirectControlled ()
bool IsMovingToHotspot ()
void OnSetPlayer (Player player)
void OnBeforeLoading (SaveFile saveFile)
void OnInitialiseScene ()
void AutoSyncHotspot ()
override void Accelerate ()
Protected Member Functions inherited from AC.NPC
void Awake ()
void StayAwayFromPlayer ()
Vector3[] TryNavPoint (Vector3 _direction, float currentDistance)
void FollowUpdate ()
float FollowCheckDistance ()
void FollowCheckDistanceMax ()
void FollowStop ()
void TurnOn ()
void TurnOff ()
Protected Member Functions inherited from AC.Char
virtual void _Awake ()
void BaseUpdate ()
void PathUpdate ()
float GetTargetSpeed ()
void AccurateAcc (float targetSpeed, bool canStop)
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 ()
float GetUpAmount (Vector3 direction)
Vector3 Flatten3D (Vector3 direction)

Protected Attributes

int id = -1
bool lockedPath
bool lockedPathCanReverse
float tankTurnFloat
Transform firstPersonCameraTransform
FirstPersonCamera firstPersonCamera
bool prepareToJump
SkinnedMeshRenderer[] skinnedMeshRenderers
Protected Attributes inherited from AC.NPC
bool isEvadingPlayer = false
Char followTarget = null
bool followTargetIsPlayer = false
float followFrequency = 0f
float followUpdateTimer = 0f
float followDistance = 0f
float followDistanceMed = 0f
float followDistanceMax = 0f
bool followFaceWhenIdle = false
bool followRandomDirection = false
bool followAcrossScenes = false
LayerMask LayerOn
LayerMask LayerOff
Protected Attributes inherited from AC.Char
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
int lockedEndIndex = -1
Rigidbody _rigidbody = null
Rigidbody2D _rigidbody2D = null
float originalGravityScale = 1f
Collider _collider = null
CharacterController _characterController
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 LockHotspotHeadTurning [get, set]
Transform FirstPersonCamera [get, set]
FirstPersonCamera FirstPersonCameraComponent [get]
InvCollection Inventory [get]
override bool IsPlayer [get]
Transform DirectMovementTargetLock [get, set]
int ID [get, set]
Properties inherited from AC.Char
CircleCollider2D CircleCollider [get]
int LockedEndIndex [get]
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]
IKLimbController LeftHandIKController [get]
IKLimbController RightHandIKController [get]
Transform Transform [get, set]
bool isTalking [get]
bool ForceTalkingMode [set]
float PathfindUpdateFrequency [get, set]
Vector3 UpDirection [get, set]

Detailed Description

Attaching this component to a GameObject and tagging it "Player" will make it an Adventure Creator Player.

Member Function Documentation

◆ _FixedUpdate()

override void AC.Player._FixedUpdate ( )
virtual

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

Reimplemented from AC.Char.

◆ _LateUpdate()

override void AC.Player._LateUpdate ( )
virtual

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

Reimplemented from AC.Char.

◆ _Update()

override void AC.Player._Update ( )
virtual

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

Reimplemented from AC.NPC.

◆ Accelerate()

override void AC.Player.Accelerate ( )
protectedvirtual

Reimplemented from AC.Char.

◆ AllDirectionsLocked()

bool AC.Player.AllDirectionsLocked ( )

Checks if the Player is prevented from being moved directly in all four directions.

Returns
True if the Player is prevented from being moved directly in all four direction

◆ CanBeDirectControlled()

override bool AC.Player.CanBeDirectControlled ( )
protectedvirtual

Reimplemented from AC.Char.

◆ CancelPathfindRecalculations()

void AC.Player.CancelPathfindRecalculations ( )

Stops the Player from re-calculating pathfinding calculations.

◆ EndPath()

override void AC.Player.EndPath ( )
virtual

Stops the character from moving along the current Paths object.

Reimplemented from AC.Char.

◆ GetTilt()

float AC.Player.GetTilt ( )

Gets the angle by which the Player's FirstPersonCamera is looking up or down, with negative values looking upward.

◆ GetTurnFloat()

override float AC.Player.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 from AC.Char.

◆ Hide()

virtual void AC.Player.Hide ( )
virtual

Hides the player's SkinnedMeshRenderers, if any exist

◆ IsActivePlayer()

override bool AC.Player.IsActivePlayer ( )
virtual

Returns True if the character is the active Player.

Reimplemented from AC.Char.

◆ IsCapableOfJumping()

override bool AC.Player.IsCapableOfJumping ( )
virtual

True if the character is capable of jumping

Reimplemented from AC.Char.

◆ IsFollowingActivePlayerAcrossScenes()

bool AC.Player.IsFollowingActivePlayerAcrossScenes ( )

Returns True if the Player is inactive, but following the active Player across scenes

◆ IsLocalPlayer()

bool AC.Player.IsLocalPlayer ( )

Checks if the player is local to the scene, and not from a prefab.

Returns
True if the player is local to the scene

◆ IsLockedToPath()

bool AC.Player.IsLockedToPath ( )

Checks if the Player is constrained to move along a Paths object during gameplay.

Returns
True if the Player is constrained to move along a Paths object during gameplay

◆ IsTilting()

bool AC.Player.IsTilting ( )

Checks if the Player's FirstPersonCamera is looking up or down.

◆ Jump()

bool AC.Player.Jump ( bool mustBeGrounded = true,
bool mustNotBeMidJump = true )

Causes the Player to jump, so long as a Rigidbody or Character Controller component is attached.

Parameters
mustBeGroundedIf True, the Player must currently be touching the ground
mustNotBeMidJumpIf True, the Player must not currently be mid-jump

<return>True if the attempt to jump was succesful

◆ LoadData()

IEnumerator AC.Player.LoadData ( PlayerData playerData)

Updates its own variables from a PlayerData class.

Parameters
playerDataThe PlayerData class to load from

◆ OnDisable()

override void AC.Player.OnDisable ( )
protectedvirtual

Reimplemented from AC.Char.

◆ OnEnable()

override void AC.Player.OnEnable ( )
protectedvirtual

Reimplemented from AC.Char.

◆ RemoveFromScene()

void AC.Player.RemoveFromScene ( bool immediately = false)

Removes the Player GameObject from the scene

◆ ReverseDirectPathDirection()

void AC.Player.ReverseDirectPathDirection ( )

Reverses which way the Player is moving along a constrained Path during gameplay

◆ SaveData()

PlayerData AC.Player.SaveData ( PlayerData playerData)

Updates a PlayerData class with its own variables that need saving.

Parameters
playerDataThe original PlayerData class
Returns
The updated PlayerData class

◆ SetHeadTurnTarget()

override void AC.Player.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 from AC.Char.

◆ SetID()

IEnumerator AC.Player.SetID ( int value)

Assigns a new ID for the Player

◆ SetLockedPath()

void AC.Player.SetLockedPath ( Paths pathOb,
bool canReverse = false,
PathSnapping pathSnapping = PathSnapping::SnapToStart,
int startingNode = 0 )

Locks the Player to a Paths object during gameplay, if using Direct movement. This allows the designer to constrain the Player's movement to a Path, even though they can move freely along it.

Parameters
pathObThe Paths to lock the Player to
canReverseIf True, the Player can move in both directions along the Path
pathSnappingThe type of snapping to enforce when first placing the Player over the Path
startingNodeIf pathSnapping = PathSnapping.SnapToNode, the node index to snap to

◆ SetTilt() [1/2]

void AC.Player.SetTilt ( float pitchAngle,
bool isInstant )

Sets the tilt of a first-person camera.

Parameters
pitchAngleThe angle to tilt the camera towards, with 0 being horizontal, positive looking downard, and negative looking upward
isInstantIf True, the camera will be rotated instantly

◆ SetTilt() [2/2]

void AC.Player.SetTilt ( Vector3 lookAtPosition,
bool isInstant )

Sets the tilt of a first-person camera.

Parameters
lookAtPositionThe point in World Space to tilt the camera towards
isInstantIf True, the camera will be rotated instantly

◆ Show()

virtual void AC.Player.Show ( )
virtual

Shows the player's SkinnedMeshRenderers, if any exist

◆ StopTankTurning()

override void AC.Player.StopTankTurning ( )
virtual

Reimplemented from AC.Char.

◆ TankTurnLeft()

void AC.Player.TankTurnLeft ( float intensity = 1f)

Makes the Player spot-turn left during gameplay. This needs to be called every frame of the turn.

Parameters
intensityThe relative speed of the turn. Set this to the value of the input axis for smooth movement.

◆ TankTurnRight()

void AC.Player.TankTurnRight ( float intensity = 1f)

Makes the Player spot-turn right during gameplay. This needs to be called every frame of the turn.

Parameters
intensityThe relative speed of the turn. Set this to the value of the input axis for smooth movement.

Member Data Documentation

◆ autoSyncHotspotState

bool AC.Player.autoSyncHotspotState = true

If True, and player-switching is enabled, then the enabled state of attached Hotspots will be synced with the player's active state

◆ hotspotDetector

DetectHotspots AC.Player.hotspotDetector

The DetectHotspots component used if SettingsManager's hotspotDetection = HotspotDetection.PlayerVicinity

◆ jumpAnim

AnimationClip AC.Player.jumpAnim

The Player's jump animation, if using Legacy animation

◆ jumpSpeed

float AC.Player.jumpSpeed = 4f

The player's jump speed

◆ toggleRun

bool AC.Player.toggleRun

True if running has been toggled

Property Documentation

◆ DirectMovementTargetLock

Transform AC.Player.DirectMovementTargetLock
getset

If set while Movement method is Direct, the Player will face this Transform at all times

◆ FirstPersonCamera

Transform AC.Player.FirstPersonCamera
getset

Assigns or sets the FirstPersonCamera Transform. This is done automatically in regular First Person mode, but must be set manually if using a custom controller, eg. Ultimate FPS.

◆ ID

int AC.Player.ID
getset

The Player's ID number, used to keep track of which Player is currently controlled

◆ Inventory

InvCollection AC.Player.Inventory
get

The Player's collection of Inventory items

◆ LockHotspotHeadTurning

bool AC.Player.LockHotspotHeadTurning
getset

The enabled state of Player's ability to head-turn towards Hotspots.