Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class tester : MonoBehaviour {
- public LayerMask la;
- // Update is called once per frame
- void Update () {
- Vector3 fwd = Camera.main.transform.TransformDirection(Vector3.forward);
- RaycastHit hit;
- if(Physics.Raycast(Camera.main.transform.position,fwd,out hit,10,la ))
- {
- Debug.DrawLine(Camera.main.transform.position, hit.point);
- print ("something in front" + hit.transform.name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement