Skip to content

Instantly share code, notes, and snippets.

@Fonserbc
Fonserbc / SwipeInput.cs
Last active September 11, 2024 22:45
A simple swipe detector for touchscreens for Unity3D. Four cardinal directions.
using UnityEngine;
/*
* Swipe Input script for Unity by @fonserbc, free to use wherever
*
* Attack to a gameObject, check the static booleans to check if a swipe has been detected this frame
* Eg: if (SwipeInput.swipedRight) ...
*
*
*/