GetButtonDown

public static bool GetButtonDown(int playerId, string elementName);
public static bool GetButtonDown(VPlayer player, string elementName);

Description

using UnityEngine;
using Volplane;

public class Demo : VolplaneBehaviour
{
    public int playerId;

    void Update()
    {
        if(VInput.GetButtonDown(playerId, "myButton"))
        {
            Debug.Log("Button pressed!");
        }
    }
}

Returns true during the frame the user starts pressing down the button identified by its element name. You need to call this method from the Update function, since the state gets reset each frame. It will not return true until the player has released the button and pressed it again.

 

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