InteractionBehaviour
- class Varwin.InteractionBehaviour
Bases:
object- class ControllerHand
Bases:
object- None_: Any = Ellipsis
- Left: Any = Ellipsis
- Right: Any = Ellipsis
- IsTouching() bool
Returns true if the object is touched at the moment. Otherwise it returns false.
Example:
result = instance.InteractionBehaviour.IsTouching()
- IsUsing() bool
Returns true if the specified object is currently used by the player. Otherwise it returns false.
Example:
result = instance.InteractionBehaviour.IsUsing()
- IsGrabbed() bool
Returns true if the specified object is currently in the hand. Otherwise it returns false.
Example:
result = instance.InteractionBehaviour.IsGrabbed()
- AddTouchStartedHandler(handler: Callable[[Object], CoroutineType]) None
The event is triggered when the player touches the specified object.
- Parameters:
handler –
Asynchronous handler function with signature:
sender (Object): the object that triggered the event
Example:
async def OnTouchStarted(sender): ... instance.InteractionBehaviour.AddTouchStartedHandler(OnTouchStarted)
- AddUseStartedHandler(handler: Callable[[int, Object], CoroutineType]) None
The event is triggered when the player uses the specified object. The object and the hand it is used with are passed in the parameters.
- Parameters:
handler –
Asynchronous handler function with signature:
hand (int): interaction hand: value from the list
Varwin.InteractionBehaviour.ControllerHand.Left (int)
Varwin.InteractionBehaviour.ControllerHand.Right (int)
sender (Object): the object that triggered the event
Example:
async def OnUseStarted(hand, sender): ... instance.InteractionBehaviour.AddUseStartedHandler(OnUseStarted)
- AddGrabStartedHandler(handler: Callable[[int, Object], CoroutineType]) None
The event is triggered when the player takes the specified object in his hand. The parameters include the object and the hand it was taken with.
- Parameters:
handler –
Asynchronous handler function with signature:
hand (int): interaction hand: value from the list
Varwin.InteractionBehaviour.ControllerHand.Left (int)
Varwin.InteractionBehaviour.ControllerHand.Right (int)
sender (Object): the object that triggered the event
Example:
async def OnGrabStarted(hand, sender): ... instance.InteractionBehaviour.AddGrabStartedHandler(OnGrabStarted)
- AddTouchEndedHandler(handler: Callable[[Object], CoroutineType]) None
The event is triggered when the player touches the specified object.
- Parameters:
handler –
Asynchronous handler function with signature:
sender (Object): the object that triggered the event
Example:
async def OnTouchEnded(sender): ... instance.InteractionBehaviour.AddTouchEndedHandler(OnTouchEnded)
- AddUseEndedHandler(handler: Callable[[int, Object], CoroutineType]) None
The event is triggered when the player uses the specified object. The object and the hand it is used with are passed in the parameters.
- Parameters:
handler –
Asynchronous handler function with signature:
hand (int): interaction hand: value from the list
Varwin.InteractionBehaviour.ControllerHand.Left (int)
Varwin.InteractionBehaviour.ControllerHand.Right (int)
sender (Object): the object that triggered the event
Example:
async def OnUseEnded(hand, sender): ... instance.InteractionBehaviour.AddUseEndedHandler(OnUseEnded)
- AddGrabEndedHandler(handler: Callable[[int, Object], CoroutineType]) None
The event is triggered when the player takes the specified object in his hand. The parameters include the object and the hand it was taken with.
- Parameters:
handler –
Asynchronous handler function with signature:
hand (int): interaction hand: value from the list
Varwin.InteractionBehaviour.ControllerHand.Left (int)
Varwin.InteractionBehaviour.ControllerHand.Right (int)
sender (Object): the object that triggered the event
Example:
async def OnGrabEnded(hand, sender): ... instance.InteractionBehaviour.AddGrabEndedHandler(OnGrabEnded)
- property CanTeleport: int
Sets whether the player can teleport or walk around the object.
- Returns:
value from the list
Varwin.InteractionBehaviour.TeleportState.Enabled
Varwin.InteractionBehaviour.TeleportState.Disabled
Example:
result = instance.InteractionBehaviour.CanTeleport
- property CanTouch: int
Sets whether the player can interact with an object using touch mechanics.
- Returns:
value from the list
Varwin.InteractionBehaviour.TouchState.Enabled
Varwin.InteractionBehaviour.TouchState.Disabled
Example:
result = instance.InteractionBehaviour.CanTouch
- property CanUse: int
Sets whether or not the player can interact with an object using the mechanics of using it (clicking on the object).
- Returns:
value from the list
Varwin.InteractionBehaviour.UseState.Enabled
Varwin.InteractionBehaviour.UseState.Disabled
Example:
result = instance.InteractionBehaviour.CanUse
- property CanGrab: int
Sets whether the player can grab the object.
- Returns:
value from the list
Varwin.InteractionBehaviour.GrabState.Enabled
Varwin.InteractionBehaviour.GrabState.Disabled
Example:
result = instance.InteractionBehaviour.CanGrab