Skip to content
Permalink
cb6b10419d
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
22 lines (17 sloc) 479 Bytes
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RayViewer : MonoBehaviour
{
public float weaponRange = 50f;
private Camera fpsCam;
void Start()
{
fpsCam = GetComponentInParent<Camera> ();
}
void Update()
{
Vector3 lineOrigin = fpsCam.ViewportToWorldPoint(new Vector3(0.5f, 05f, 0));
Debug.DrawRay(lineOrigin, fpsCam.transform.forward * weaponRange, Color.green);
}
}