Skip to main content

CharacterLocalityController

A class in Root.Township, Alta.Character.

The player character's locality controller: when a player is marked local or remote it picks the head transform and wires the head target, body, voice chat and ghost hands to it.

Constructors​

MemberWhat it is
CharacterLocalityController()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

6 private and internal fields
MemberWhat it is
private BodyController bodyControllerThe body controller whose Head is set to the chosen head.
private NetworkTransform headNetworkTransformNetwork transform for the head. Not used in this class's code.
private Transform headTargetTransform re-parented under the chosen head.
private Transform localHeadHead object activated when the character is the local player.
private Transform remoteHeadHead used by default (remote players).
private LerpFollow voiceChatFollowFollower that keeps the voice chat source on the head.

Properties​

MemberWhat it is
Transform Head { get; set; }The head transform in use. Set to the remote head in Awake; the head target, body and voice chat follow it.

Methods​

MemberWhat it is
override void SetLocality(bool isLocal)Marks the character local or remote, sets up heads, turns ghost hands on only when local, and on Android fades in after cosmetics pack.
protected void Awake()Starts with Head set to the remote head.
protected virtual void SetupLocalAndRemoteHeads(bool isLocalPlayer)Parents the head target to Head and points the body controller and voice chat follower at it.
1 private and internal method
MemberWhat it is
private void FinishedPackingCharacterCosmetics()Android only: removes the screen fade lock a second after cosmetics finish packing, and hides the clothes on Quest when the app lacks input focus.

Used in​

Members of other types that take, return or hold a CharacterLocalityController: