- Home /
Question by
pippo19 · Dec 30, 2013 at 11:37 AM ·
javascriptvariable
Javascript
hi all, i have do it in C#
GameObject asso = GameObject.Find("First Person Controller");
Vitaplayer vitaplayer = asso.GetComponent<Vitaplayer>();
vitaplayer.health -= danno;
but i need in javascript how i can do it? because in the second row unity give me an error..
thanks
Comment
Answer by MagicoCreator · Dec 30, 2013 at 12:20 PM
in unityscript this would be:
var asso : GameObject = GameObject.Find("First Person Controller");
var vitaplayer : Vitaplayer = asso.GetComponent(Vitaplayer);
vitaplayer.health -= danno;