I making a game. You need bomb car and heal with water…
var Gyfka : int;
var GoodTag : String[];
var BadTag : String[];
var Ugnis : Transform[];
var Dumai : Transform;
var Groteles : Transform;
var Ratai : Transform[];
var Sprogimas : GameObject;
function OnCollisionEnter(other : Collision){
Debug.Log("Test");
if (other.collider.gameObject.tag == GoodTag)
{
Gyfka += 6;
}
if (other.collider.gameObject.tag == BadTag)
{
Gyfka -= 37;
}
}
function Update(){
if(Gyfka >=25){
Dumai.particleEmitter.emit = true;
}
if(Gyfka >=10){
Ugnis.particleEmitter.emit = true;
}
if(Gyfka >=1){
Instantiate(Sprogimas, Groteles.transform.posion, Quaternion.identity);
Ratai.GetComponent(HingeJoint).enabled = false;
}
}
function OnGUI(){
GUI.Box(new Rect (10,Screen.height - 200,200,20), "Riebulkos Mašinos Sveikata:" + Gyfka);
}
I working with this script for 3 days. It starts me angry
WHAT I DID WRoNG
I put this on car’s collider
You posted 16 minutes ago, so first : be more patient ... Second : there is no question ! What is the problem ? What is happening ? Or what is not happening and should ?
– KiraSenseiThis might help you understand things better: [Unity Tips and Tricks][1] [1]: http://www.youtube.com/watch?v=Spwx_44WzbQ
– insominxYou are comparing a tag with a list of string, does this even compile ?
– KiraSenseiPost a question that explains in more depth the problem you have. Being angry, and working on it for 3 days isn't enough information for anyone to help you. It might take the community a day or more to help you. The more detail you can add about the problem, the better your chances of getting help.
– Graham-Dunnett