OnTouch

Description

using UnityEngine;
using Volplane;

public class Demo : VolplaneBehaviour
{
    void OnTouch(int playerId, string elementName, Vector2 coordinates)
    {
        Vector3 fromTouch = new Vector3(coordinates.x, 0f, coordinates.y);

        Debug.LogFormat(
            "Player {0:D} has touched '{1:G}'.",
            playerId,
            elementName
        );

        // Move object
        transform.position = fromTouch;
    }
}

Gets called when a touch area input on a players controller is registered. See VInput for a more common input handling.

 

playerId The player identifier.
elementName The name identifier of the registered touch area.
coordinates The coordinates representing the touch area (0.0 to 1.0 horizontal and vertical).