Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
595 B
1
Indexable
Never
    void ConstantOnHeld()
    {
        if (Input.GetKeyDown("Whatever"))
        {
            //On Down Event
        }
        else if (Input.GetKey("Whatever"))
        {
            //On Held Every Frame
        }
    }

    bool HeldCheck;
    void OnceOnHeld()
    {
        bool Held = Input.GetKey("Whatever");

        if (Input.GetKeyDown("Whatever"))
        {
            //On Down Event
        }
        else if (!HeldCheck && Held)
        {
            HeldCheck = true;
            //On Held Initially
        }
        
        if (!Held && HeldCheck) HeldCheck = false;
    }