Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using UnityEngine;
public class TouchTest : MonoBehaviour {
[SerializeField] UnityEngine.UI.Text label;
[SerializeField] ContactFilter2D filter2d;
void Update ()
{
var isTouched = GetComponent<Rigidbody2D>().IsTouching(filter2d);
label.text = string.Format("Touch : {0}", isTouched);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment