Skip to content

Instantly share code, notes, and snippets.

@FrankNine
Created August 7, 2019 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrankNine/3e33e6264b8aedc2ab857900d2e27964 to your computer and use it in GitHub Desktop.
Save FrankNine/3e33e6264b8aedc2ab857900d2e27964 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class BlockRotation : MonoBehaviour
{
private bool _isOverlapped;
private void Update()
{
if (Input.GetKeyDown(KeyCode.E) && _isOverlapped)
{
Debug.Log("Flip");
}
}
private void OnTriggerEnter(Collider other)
{
_isOverlapped = true;
}
private void OnTriggerExit(Collider other)
{
_isOverlapped = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment