GetSwipeDistance

public static float GetSwipeDistance(int playerId, string elementName);
public static float GetSwipeDistance(VPlayer player, string elementName);

Description

using UnityEngine;
using Volplane;

public class Demo : VolplaneBehaviour
{
    public int playerId;

    void Update()
    {
        // Check for triggered swipe field
        if(VInput.GetInput(playerId, "swipe-field"))
        {
            // Output registered swipe vector
            Debug.Log("Swipe detected!");
            Debug.Log(VInput.GetSwipeDistance(playerId, "swipe-field"));
        }
    }
}

Returns the distance moved on the swipe field until it was triggered in pixels. This method only returns valid data when used with an analog swipe field.

 

playerId The player identifier.
player A player object.
elementName The name identifier of the input element set in the controller editor.