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

The name 'Flashlight' doesn't exist in the current context

$
0
0
I'm using Visual Studio 2010 Pro to write some script for a horror game that I am making, but when I try to enter the word "Flashlight" in Flashlight.BatteryLife, Flashlight is underlined in red saying that it doesn't exist in the current context. The word "Flashlight" should be a light blue when I add a period after it. I'll post my code. Please help! using UnityEngine; using System.Collections; public class HUD : MonoBehaviour { public static int BatteryCount; public static bool HasFlashlight; void OnGUI() { if (HasFlashlight) { GUI.Label(new Rect(10, 10, 80, 30), "Flashlight"); GUI.Label(new Rect(70, 10, 80, 30), Flashlight.BatteryLife.ToString("F2")); } } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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