Skip to content

Instantly share code, notes, and snippets.

View SenshiSentou's full-sized avatar

Patrick Boelens (bluetomato) SenshiSentou

View GitHub Profile
@SenshiSentou
SenshiSentou / CustomHoldingInteraction.cs
Last active July 11, 2023 14:11 — forked from Invertex/CustomHoldingInteraction.cs
Unity New Input System custom Hold "Interaction" where the .performed callback is constantly triggered while input is held.
using UnityEngine;
using UnityEngine.InputSystem;
//!!>> This script should NOT be placed in an "Editor" folder. Ideally placed in a "Plugins" folder.
namespace Invertex.UnityInputExtensions.Interactions {
//https://gist.github.com/Invertex
/// <summary>
/// Custom Hold interaction for New Input System.
/// With this, the .performed callback will be called everytime the Input System updates.
/// Allowing a purely callback based approach to a button hold instead of polling it in an Update() loop or creating specific logic for it