Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Assigned variable has not been assigned?

$
0
0
Here is a screen shot of the glitch. As you can see, Sight Start has an assigned variable but the error still pops up. Am I missing something? Thanks in advance for the help :D ![alt text][1] [1]: /storage/temp/24563-sightstart+glitch.png Here is the script code.. using UnityEngine; using System.Collections; public class PlayerDetect : MonoBehaviour { public Transform sightStart; public Transform sightEnd; public bool spotted = false; void Update () { Raycasting (); Behaviors (); } void Raycasting(){ Debug.DrawLine(sightStart.position, sightEnd.position, Color.blue); spotted = Physics.Linecast(sightStart.position, sightEnd.position, 1 << LayerMask.NameToLayer("player")); } void Behaviors(){ } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>