• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    TapHandler

    Inherits from:

    A TapHandler is a class that can be used to detect when a GameObject has been tapped. In order for a GameObject to be tappable, it must also have a Collider component attached to the same GameObject as the TapHandler or to a parent GameObject.

    Properties

    Tapped

    ClientOnly
    ReadOnly

    Event fired when the tap handler is activated. Connect to this event to add custom behavior when the tap handler is tapped. Event Parameters: Position: the position on the TapHandler's collider that was tapped.

    distance

    number
    ClientOnly

    If CheckDistance is enabled, the character must be within this distance of the tap handler when it is tapped for it to activate. If move to is enabled, if the character is too far away, they will move within this distance of the TapHandler and then activate it.

    hasAnchors

    boolean
    ClientOnly
    ReadOnly

    Returns true if the tap handler has anchors

    moveTarget

    ClientOnly
    ReadOnly

    If the character has to move to activate the move handler, this is the position the character will move to. This is the position of the move target if it exists, otherwise it is the tap handler's position.

    moveTo

    boolean
    ClientOnly

    If CheckDistance is enabled, when a tap handler is tapped and the character is outside the tap handler's distance, the character will move to the TapHandler and activate it if MoveTo is true. If MoveTo is false, nothing happens.

    Methods

    Returns the closest anchor to the given world position

    Parameters

    position

    The position to check for the nearest anchor.

    Returns

    The closest anchor associated with this TapHandler, if it exists.

    Perform

    ClientOnly

    Activates the TapHandler as if it had been tapped.

    Parameters

    position

    The position on the tap handler's collider that was tapped.

    Returns

    void

    Updated 7 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.