Quantcast
Channel: Latest Questions by Gamershaze
Viewing all articles
Browse latest Browse all 73

Help accessing a variable in a C# file from a JavaScript file~

$
0
0
Hey everyone. I know this question has been asked before, but I followed the guide all of the other similar questions lead to; and I can't get it to work quite right. Here's a link to the original guide for reference sake. [http://www.41post.com/1935/programming/unity3d-js-cs-or-cs-js-access][1] Currently, this is my code: var DamageObject : GameObject; var csScript : vp_PlayerDamageHandler; function Awake() { //Get the CSharp Script csScript = DamageObject.GetComponent("vp_PlayerDamageHandler"); } function OnGUI() { GUI.Label(new Rect(10,30,500,20), csScript.isDead); } isDead is the boolean variable I want to access from the C# script vp_PlayerDamageHandler. The original code used this.Getcomponent, so figuring it would look in the object this script is on- I declared a DamageObject variable. With the above code, I receive the following error: **"The name 'vp_PlayerDamageHandler' does not denote a valid type ('not found'). "** Thanks for anyone who can help, it's greatly appreciated as always. [1]: http://www.41post.com/1935/programming/unity3d-js-cs-or-cs-js-access

Viewing all articles
Browse latest Browse all 73

Trending Articles



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