Interaction
public static class InteractionNamespace NodeWorld.Flux.
What players do with the objects of the world: use them, take them in hand, and the text they see when pointing at them. It happens on each player's game; the server refuses these calls.
Methods
SetGrabbable
public static void SetGrabbable(GameObject gameObject, bool grabbable)Players can grab the object with their hands (it needs a collider): OnGrab, OnDrop.
SetInteractable
public static void SetInteractable(GameObject gameObject, bool interactable)Players can use the object (point at it and press the trigger): OnInteract.
SetText
public static void SetText(GameObject gameObject, string text)The text a player sees when pointing at the object ("Sit", "Take off"...); empty: none.
GetText
public static string GetText(GameObject gameObject)The text players see when pointing at the object.
SetGrabOptions
public static void SetGrabOptions(GameObject gameObject, bool exactGrip, bool allowTheft)How the object is held: exactGrip, it stays where the hand took it (false: it snaps to the hand); allowTheft, another player may take it from the hand of the one holding it.
IsHeld
public static bool IsHeld(GameObject gameObject)The local player holds the object.
GetHand
public static Hand GetHand(GameObject gameObject)The hand of the local player that holds the object (None if it does not).
GetHeld
public static GameObject GetHeld(Hand hand)The object the local player holds in that hand, or null.
Drop
public static void Drop(GameObject gameObject)The local player lets the object go (OnDrop).
