-
-
Save FCkaisei/04ee0a660f864da4863c6518df50fdd5 to your computer and use it in GitHub Desktop.
C#
This file contains 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
using UnityEngine; | |
using System.Collections; | |
public class raySet : MonoBehaviour { | |
float y; | |
void FixedUpdate () | |
{ | |
Vector3 fwd = transform.TransformDirection (Vector3.forward * 10); | |
Debug.DrawRay (transform.position, fwd, Color.blue, 0.1f); | |
if (Physics.Raycast (transform.position, fwd, 200)) { | |
print ("There is something in front of the object!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment