OnDPad

Description

using UnityEngine;
using Volplane;

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

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

        // Move object
        transform.Translate(fromDPad * Time.deltaTime);
    }
}

Gets called when a dpad 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 dpad element.
axis The axis coordinates representing the dpad.