Skip to content

Instantly share code, notes, and snippets.

@Fonserbc
Fonserbc / SwipeInput.cs
Last active April 27, 2023 04:28
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) ...
*
*
*/