Cookie042

Untitled

Sep 13th, 2020
760
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2.  
  3. public class CheckSphereTest : MonoBehaviour
  4. {
  5.     public LayerMask mask;
  6.    
  7.     private void OnDrawGizmos()
  8.     {
  9.         var hit = Physics.CheckSphere(transform.position, 1, mask);
  10.         Gizmos.matrix = transform.localToWorldMatrix;
  11.         Gizmos.color = hit ? Color.green : Color.red;
  12.         Gizmos.DrawWireSphere(Vector3.zero, 1);
  13.     }
  14. }
  15.  
RAW Paste Data