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
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.