Advertisement
Cookie042

Untitled

Sep 13th, 2020
887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement