Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
getInput(name:)
Returns a Variant
for the input with the given name
. This works for any input type, the variant will be typed according to the actions configuration.
final func getInput(name: StringName) -> Variant
Other members in extension
Types
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal4
Signal support.
Type members
Instance members
var inputFloatChanged: Signal3
Emitted when a trigger or similar input on this controller changes value.
var inputVector2Changed: Signal4
Emitted when a thumbstick or thumbpad on this controller is moved.
func getFloat(name: StringName
) -> Double Returns a numeric value for the input with the given
name
. This is used for triggers and grip sensors.func getTrackerHand(
) -> XRPositionalTracker.TrackerHand Returns the hand holding this controller, if known. See
XRPositionalTracker.TrackerHand
.func getVector2(name: StringName
) -> Vector2 Returns a
Vector2
for the input with the givenname
. This is used for thumbsticks and thumbpads found on many controllers.func isButtonPressed(name: StringName
) -> Bool Returns
true
if the button with the givenname
is pressed.