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

Get Component Errors

$
0
0
In my scripts I'm trying to locate two other components and disable them from an inventory system. My Script: private var showGUI : boolean = false; function Update() { if (Input.GetKeyDown ("i")) { showGUI = !showGUI; } if (showGUI == true) { Time.timeScale = 0; GameObject.Find("Player").GetComponent(ClickToMove).enabled = false; GameObject.Find("PlayerCam").GetComponent(UserCamera).enabled = false; } } The script detects the Gameobjects: "Player", and "PlayerCam", but it does not detect the component scripts: "ClickToMove", and "UserCamera", even though I've checked, double checked, renamed, and triple checked, that the files were there, and that the names matched it doesn't detect either of the two scripts. Any help is greatly appreciated.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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