Guides
Guides
These docs are for v3.1.0. Click to read the latest docs for v3.3.0.

SDK_FallbackController

extends SDK_BaseController

Overview

The Base Controller SDK script provides a bridge to SDK methods that deal with the input devices.

This is the fallback class that will just return default values.

Class Methods

ProcessUpdate/2

public override void ProcessUpdate(uint index, Dictionary<string, object> options)

  • Parameters
  • uint index - The index of the controller.
  • Dictionary<string, object> options - A dictionary of generic options that can be used to within the update.
  • Returns
  • none

The ProcessUpdate method enables an SDK to run logic for every Unity Update

GetControllerDefaultColliderPath/1

public override string GetControllerDefaultColliderPath(ControllerHand hand)

  • Parameters
  • ControllerHand hand - The controller hand to check for
  • Returns
  • string - A path to the resource that contains the collider GameObject.

The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.

GetControllerElementPath/3

public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)

  • Parameters
  • ControllerElements element - The controller element to look up.
  • ControllerHand hand - The controller hand to look up.
  • bool fullPath - Whether to get the initial path or the full path to the element.
  • Returns
  • string - A string containing the path to the game object that the controller element resides in.

The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.

GetControllerIndex/1

public override uint GetControllerIndex(GameObject controller)

  • Parameters
  • GameObject controller - The GameObject containing the controller.
  • Returns
  • uint - The index of the given controller.

The GetControllerIndex method returns the index of the given controller.

GetControllerByIndex/2

public override GameObject GetControllerByIndex(uint index, bool actual = false)

  • Parameters
  • uint index - The index of the controller to find.
  • bool actual - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  • Returns
  • GameObject -

The GetControllerByIndex method returns the GameObject of a controller with a specific index.

GetControllerOrigin/1

public override Transform GetControllerOrigin(GameObject controller)

  • Parameters
  • GameObject controller - The controller to retrieve the origin from.
  • Returns
  • Transform - A Transform containing the origin of the controller.

The GetControllerOrigin method returns the origin of the given controller.

GenerateControllerPointerOrigin/1

public override Transform GenerateControllerPointerOrigin(GameObject parent)

  • Parameters
  • GameObject parent - The GameObject that the origin will become parent of. If it is a controller then it will also be used to determine the hand if required.
  • Returns
  • Transform - A generated Transform that contains the custom pointer origin.

The GenerateControllerPointerOrigin method can create a custom pointer origin Transform to represent the pointer position and forward.

GetControllerLeftHand/1

public override GameObject GetControllerLeftHand(bool actual = false)

  • Parameters
  • bool actual - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  • Returns
  • GameObject - The GameObject containing the left hand controller.

The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.

GetControllerRightHand/1

public override GameObject GetControllerRightHand(bool actual = false)

  • Parameters
  • bool actual - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  • Returns
  • GameObject - The GameObject containing the right hand controller.

The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.

IsControllerLeftHand/1

public override bool IsControllerLeftHand(GameObject controller)

  • Parameters
  • GameObject controller - The GameObject to check.
  • Returns
  • bool - Returns true if the given controller is the left hand controller.

The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.

IsControllerRightHand/1

public override bool IsControllerRightHand(GameObject controller)

  • Parameters
  • GameObject controller - The GameObject to check.
  • Returns
  • bool - Returns true if the given controller is the right hand controller.

The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.

IsControllerLeftHand/2

public override bool IsControllerLeftHand(GameObject controller, bool actual)

  • Parameters
  • GameObject controller - The GameObject to check.
  • bool actual - If true it will check the actual controller, if false it will check the script alias controller.
  • Returns
  • bool - Returns true if the given controller is the left hand controller.

The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.

IsControllerRightHand/2

public override bool IsControllerRightHand(GameObject controller, bool actual)

  • Parameters
  • GameObject controller - The GameObject to check.
  • bool actual - If true it will check the actual controller, if false it will check the script alias controller.
  • Returns
  • bool - Returns true if the given controller is the right hand controller.

The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.

GetControllerModel/1

public override GameObject GetControllerModel(GameObject controller)

  • Parameters
  • GameObject controller - The GameObject to get the model alias for.
  • Returns
  • GameObject - The GameObject that has the model alias within it.

The GetControllerModel method returns the model alias for the given GameObject.

GetControllerModel/1

public override GameObject GetControllerModel(ControllerHand hand)

  • Parameters
  • ControllerHand hand - The hand enum of which controller model to retrieve.
  • Returns
  • GameObject - The GameObject that has the model alias within it.

The GetControllerModel method returns the model alias for the given controller hand.

GetControllerRenderModel/1

public override GameObject GetControllerRenderModel(GameObject controller)

  • Parameters
  • GameObject controller - The GameObject to check.
  • Returns
  • GameObject - A GameObject containing the object that has a render model for the controller.

The GetControllerRenderModel method gets the game object that contains the given controller's render model.

SetControllerRenderModelWheel/2

public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)

  • Parameters
  • GameObject renderModel - The GameObject containing the controller render model.
  • bool state - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  • Returns
  • none

The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.

HapticPulseOnIndex/2

public override void HapticPulseOnIndex(uint index, float strength = 0.5f)

  • Parameters
  • uint index - The index of the tracked object to initiate the haptic pulse on.
  • float strength - The intensity of the rumble of the controller motor. 0 to 1.
  • Returns
  • none

The HapticPulseOnIndex method is used to initiate a simple haptic pulse on the tracked object of the given index.

GetHapticModifiers/0

public override SDK_ControllerHapticModifiers GetHapticModifiers()

  • Parameters
  • none
  • Returns
  • SDK_ControllerHapticModifiers - An SDK_ControllerHapticModifiers object with a given durationModifier and an intervalModifier.

The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.

GetVelocityOnIndex/1

public override Vector3 GetVelocityOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • Vector3 - A Vector3 containing the current velocity of the tracked object.

The GetVelocityOnIndex method is used to determine the current velocity of the tracked object on the given index.

GetAngularVelocityOnIndex/1

public override Vector3 GetAngularVelocityOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • Vector3 - A Vector3 containing the current angular velocity of the tracked object.

The GetAngularVelocityOnIndex method is used to determine the current angular velocity of the tracked object on the given index.

GetTouchpadAxisOnIndex/1

public override Vector2 GetTouchpadAxisOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • Vector2 - A Vector2 containing the current x,y position of where the touchpad is being touched.

The GetTouchpadAxisOnIndex method is used to get the current touch position on the controller touchpad.

GetTriggerAxisOnIndex/1

public override Vector2 GetTriggerAxisOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • Vector2 - A Vector2 containing the current position of the trigger.

The GetTriggerAxisOnIndex method is used to get the current trigger position on the controller.

GetGripAxisOnIndex/1

public override Vector2 GetGripAxisOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • Vector2 - A Vector2 containing the current position of the grip.

The GetGripAxisOnIndex method is used to get the current grip position on the controller.

GetTriggerHairlineDeltaOnIndex/1

public override float GetTriggerHairlineDeltaOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • float - The delta between the trigger presses.

The GetTriggerHairlineDeltaOnIndex method is used to get the difference between the current trigger press and the previous frame trigger press.

GetGripHairlineDeltaOnIndex/1

public override float GetGripHairlineDeltaOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • float - The delta between the grip presses.

The GetGripHairlineDeltaOnIndex method is used to get the difference between the current grip press and the previous frame grip press.

IsTriggerPressedOnIndex/1

public override bool IsTriggerPressedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being pressed.

The IsTriggerPressedOnIndex method is used to determine if the controller button is being pressed down continually.

IsTriggerPressedDownOnIndex/1

public override bool IsTriggerPressedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been pressed down.

The IsTriggerPressedDownOnIndex method is used to determine if the controller button has just been pressed down.

IsTriggerPressedUpOnIndex/1

public override bool IsTriggerPressedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsTriggerPressedUpOnIndex method is used to determine if the controller button has just been released.

IsTriggerTouchedOnIndex/1

public override bool IsTriggerTouchedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being touched.

The IsTriggerTouchedOnIndex method is used to determine if the controller button is being touched down continually.

IsTriggerTouchedDownOnIndex/1

public override bool IsTriggerTouchedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been touched down.

The IsTriggerTouchedDownOnIndex method is used to determine if the controller button has just been touched down.

IsTriggerTouchedUpOnIndex/1

public override bool IsTriggerTouchedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsTriggerTouchedUpOnIndex method is used to determine if the controller button has just been released.

IsHairTriggerDownOnIndex/1

public override bool IsHairTriggerDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has passed it's press threshold.

The IsHairTriggerDownOnIndex method is used to determine if the controller button has passed it's press threshold.

IsHairTriggerUpOnIndex/1

public override bool IsHairTriggerUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released from it's press threshold.

The IsHairTriggerUpOnIndex method is used to determine if the controller button has been released from it's press threshold.

IsGripPressedOnIndex/1

public override bool IsGripPressedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being pressed.

The IsGripPressedOnIndex method is used to determine if the controller button is being pressed down continually.

IsGripPressedDownOnIndex/1

public override bool IsGripPressedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been pressed down.

The IsGripPressedDownOnIndex method is used to determine if the controller button has just been pressed down.

IsGripPressedUpOnIndex/1

public override bool IsGripPressedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsGripPressedUpOnIndex method is used to determine if the controller button has just been released.

IsGripTouchedOnIndex/1

public override bool IsGripTouchedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being touched.

The IsGripTouchedOnIndex method is used to determine if the controller button is being touched down continually.

IsGripTouchedDownOnIndex/1

public override bool IsGripTouchedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been touched down.

The IsGripTouchedDownOnIndex method is used to determine if the controller button has just been touched down.

IsGripTouchedUpOnIndex/1

public override bool IsGripTouchedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsGripTouchedUpOnIndex method is used to determine if the controller button has just been released.

IsHairGripDownOnIndex/1

public override bool IsHairGripDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has passed it's press threshold.

The IsHairGripDownOnIndex method is used to determine if the controller button has passed it's press threshold.

IsHairGripUpOnIndex/1

public override bool IsHairGripUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released from it's press threshold.

The IsHairGripUpOnIndex method is used to determine if the controller button has been released from it's press threshold.

IsTouchpadPressedOnIndex/1

public override bool IsTouchpadPressedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being pressed.

The IsTouchpadPressedOnIndex method is used to determine if the controller button is being pressed down continually.

IsTouchpadPressedDownOnIndex/1

public override bool IsTouchpadPressedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been pressed down.

The IsTouchpadPressedDownOnIndex method is used to determine if the controller button has just been pressed down.

IsTouchpadPressedUpOnIndex/1

public override bool IsTouchpadPressedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsTouchpadPressedUpOnIndex method is used to determine if the controller button has just been released.

IsTouchpadTouchedOnIndex/1

public override bool IsTouchpadTouchedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being touched.

The IsTouchpadTouchedOnIndex method is used to determine if the controller button is being touched down continually.

IsTouchpadTouchedDownOnIndex/1

public override bool IsTouchpadTouchedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been touched down.

The IsTouchpadTouchedDownOnIndex method is used to determine if the controller button has just been touched down.

IsTouchpadTouchedUpOnIndex/1

public override bool IsTouchpadTouchedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsTouchpadTouchedUpOnIndex method is used to determine if the controller button has just been released.

IsButtonOnePressedOnIndex/1

public override bool IsButtonOnePressedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being pressed.

The IsButtonOnePressedOnIndex method is used to determine if the controller button is being pressed down continually.

IsButtonOnePressedDownOnIndex/1

public override bool IsButtonOnePressedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been pressed down.

The IsButtonOnePressedDownOnIndex method is used to determine if the controller button has just been pressed down.

IsButtonOnePressedUpOnIndex/1

public override bool IsButtonOnePressedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsButtonOnePressedUpOnIndex method is used to determine if the controller button has just been released.

IsButtonOneTouchedOnIndex/1

public override bool IsButtonOneTouchedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being touched.

The IsButtonOneTouchedOnIndex method is used to determine if the controller button is being touched down continually.

IsButtonOneTouchedDownOnIndex/1

public override bool IsButtonOneTouchedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been touched down.

The IsButtonOneTouchedDownOnIndex method is used to determine if the controller button has just been touched down.

IsButtonOneTouchedUpOnIndex/1

public override bool IsButtonOneTouchedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsButtonOneTouchedUpOnIndex method is used to determine if the controller button has just been released.

IsButtonTwoPressedOnIndex/1

public override bool IsButtonTwoPressedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being pressed.

The IsButtonTwoPressedOnIndex method is used to determine if the controller button is being pressed down continually.

IsButtonTwoPressedDownOnIndex/1

public override bool IsButtonTwoPressedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been pressed down.

The IsButtonTwoPressedDownOnIndex method is used to determine if the controller button has just been pressed down.

IsButtonTwoPressedUpOnIndex/1

public override bool IsButtonTwoPressedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsButtonTwoPressedUpOnIndex method is used to determine if the controller button has just been released.

IsButtonTwoTouchedOnIndex/1

public override bool IsButtonTwoTouchedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being touched.

The IsButtonTwoTouchedOnIndex method is used to determine if the controller button is being touched down continually.

IsButtonTwoTouchedDownOnIndex/1

public override bool IsButtonTwoTouchedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been touched down.

The IsButtonTwoTouchedDownOnIndex method is used to determine if the controller button has just been touched down.

IsButtonTwoTouchedUpOnIndex/1

public override bool IsButtonTwoTouchedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsButtonTwoTouchedUpOnIndex method is used to determine if the controller button has just been released.

IsStartMenuPressedOnIndex/1

public override bool IsStartMenuPressedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being pressed.

The IsStartMenuPressedOnIndex method is used to determine if the controller button is being pressed down continually.

IsStartMenuPressedDownOnIndex/1

public override bool IsStartMenuPressedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been pressed down.

The IsStartMenuPressedDownOnIndex method is used to determine if the controller button has just been pressed down.

IsStartMenuPressedUpOnIndex/1

public override bool IsStartMenuPressedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsStartMenuPressedUpOnIndex method is used to determine if the controller button has just been released.

IsStartMenuTouchedOnIndex/1

public override bool IsStartMenuTouchedOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button is continually being touched.

The IsStartMenuTouchedOnIndex method is used to determine if the controller button is being touched down continually.

IsStartMenuTouchedDownOnIndex/1

public override bool IsStartMenuTouchedDownOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been touched down.

The IsStartMenuTouchedDownOnIndex method is used to determine if the controller button has just been touched down.

IsStartMenuTouchedUpOnIndex/1

public override bool IsStartMenuTouchedUpOnIndex(uint index)

  • Parameters
  • uint index - The index of the tracked object to check for.
  • Returns
  • bool - Returns true if the button has just been released.

The IsStartMenuTouchedUpOnIndex method is used to determine if the controller button has just been released.