How can i get this script to work ????
Hi!I need some help.I've made a script that when i press 1 to show my mace and then when i press 2 my mace to dissapear and my axe to appear.I am trying to do a class system for a mmoprg. here is my script(it is JS btw).If you could help me i will be very glad.C# answers are good too.
pragma strict
var Mace : GameObject; var Axe : GameObject;
function Update () {
if(Input.GetKeyDown("1"))
Mace.GetComponent.<Renderer>().gameObject.active = true;
} { if(Input.GetKeyDown("2")) Mace.GetComponent.().gameObject.active = false; Axe.GetComponent.().gameObject.active = true; }
Your answer
Follow this Question
Related Questions
Help: NPC Animation from trigger animation back to idle animation C# 1 Answer
How can I create and apply SuperNES-esque affine Transformations into my project? 0 Answers
Own player controller script let the view wobbles but why? 0 Answers
enemy following issue 0 Answers
gameObject movement too slow 1 Answer