Skip to main content

GhostHandController

A class in Root.Township, Alta.Character.

Shows the translucent ghost hand at the controller position and fades it by how far the real hand is from it. Only active on the local player; skipped on headless servers.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private static int _FadeProgressShader property ID for the fade amount.
private Controller controllerBacking field for Controller.
private float desiredAlphaLast requested alpha, reapplied when focus returns.
private RendererGroup ghostHandRenderersBacking field for GhostHandRenderers.
private bool hasFocusFalse while the Quest app lacks input focus.

Properties​

MemberWhat it is
Controller Controller { get; }The hand controller on the same object.
RendererGroup GhostHandRenderers { get; }Renderers that make up the ghost hand.
bool IsUpdatingAlpha { get; set; }When true, the alpha follows the distance between the ghost and master hand each update.
GhostHandSettings Settings { get; }Shortcut to PlayerSettings.GhostHandSettings.

Methods​

MemberWhat it is
void QuestFocusForceDisabled()Hides the ghost hand while the Quest app has lost input focus.
void QuestFocusForceReenabled()Restores the ghost hand and its last wanted alpha when Quest input focus returns.
void RefreshRendererGroup()Re-collects the renderers under the ghost hand group.
void SetGhostHandActive(bool isActive)Turns the component and the ghost hand object on or off. Called with the player's locality.
void SetGhostHandAlpha(float alpha)Sets the fade amount; renderers turn off below 0.01. On Android it waits until focus returns.
override void UpdateCharacterComponent()Updates the alpha from distance to the master hand when IsUpdatingAlpha is on.
3 private and internal methods
MemberWhat it is
private void Awake()Off headless: reads whether to fade from settings and makes the renderers use material instances.
private void Start()On Quest without input focus, hides the ghost hand straight away.
private void UpdateGhostHandRenderers(float alpha)Enables the renderers and writes the _FadeProgress shader value.

Used in​

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