Created
May 7, 2019 13:36
-
-
Save nopitech/e5d43200c92ab1f1fab9776a97d85fb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RaycastHit hit; | |
void Update() | |
{ | |
// レイ飛ばす | |
if (Physics.BoxCast(transform.position, Vector3.one * 0.5f, transform.TransformDirection(Vector3.up), out hit)) | |
{ | |
Debug.Log(hit.collider.gameObject.name); | |
} | |
} | |
// 表示(シーンビューのみ) | |
void OnDrawGizmosSelected() | |
{ | |
Gizmos.DrawWireCube(hit.point, Vector3.one * 0.5f); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment