I'm having some problems with the tags at the unity, they are not working i think.
What i want is that when the character collides with the ammo, the ammo object is destroyed, and then the character ammo is recharged.
here is the code:
#pragma strict
function Start () {
}
function Update () {
}
function OnCollisionEnter(collision: Collision)
{
if (collision.gameObject.tag == "jogador")
{
Destroy(gameObject);
Arma.contMunicao = Arma.contMunicao+100;
}
}
----------
the variables are in portuguese(br)
the character is tagged with the tag "jogador", but when it collides nothing happens.
the collision is working well so i think is a problem with the tags. waiting :)
↧