- Home /
Reference C sharp script from Javascript
ok, so I have a javascript set up to create an inventory system. what I want to do, is include a player stats menu with it. (I'm just gonna have health for now, I don't actually have any other stats set up yet.)
now, for my health script, I used C#. I want to know if there is an easy way to referance this script in my inventory script. is that possible? because what I first used was this bit in the start function
HP_Script = GetComponent(PlayerHealth);
and then I had a series of variable referencing HP_Script to set up the GUI. but it gave me an error saying that it couldn't find PlayerHealth. I tried going into the inspector and adding the script to the HP_Script target manually, but it doesn't let me.
any help would be greatly appriciated
Answer by Eric5h5 · Jul 24, 2011 at 06:06 PM
http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html , though it would be better if you just used Javascript for your health script; mixing languages in this case is needlessly complicating things.
Your answer
Follow this Question
Related Questions
Reference JS string to C# 1 Answer
try to use values of c# script in a Javascript, Unity collapsed 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Character falls through the ground 1 Answer