Skip to content
Discussion options

You must be logged in to vote

I don't think you pasted your logic properly, looking at it shows that the text cannot ever toggle off, I ended up testing it just in case and it does toggle on but never turns off - as expected.
If it does end up operating in the way I just described, then if you want to toggle it on and off by pressing the button you can use the following:

bool virtualBtnHeld;
public override void Update()
{
    var aimModeButton = Input.GetVirtualButton(0, "Aim Mode");

    // Note: Gamepad sticks can be a negative value. For this example we only check if the value is higher than 0
    if (aimModeButton == 1 && !virtualBtnHeld)
        aimModeActive = !aimModeActive;
    virtualBtnHeld = aimModeButton == 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DusaWitch
Comment options

Answer selected by DusaWitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants