Hello guys, i make a Pickup script of ammo, 1 script in AmmoBox with information of quantity of ammo and when i put mouse over the ammo box show on gui the ammo of the ammoBox, i I used Raycast, “Hit.collider.gameObject” Here the code with only the GetComponent:
var otherObject = Hit.collider.gameObject;
municaoAtual = otherObject.GetComponent("AmmoBox").bulletsAmount;
But, the GetComponent is not returning show only “0” and in log not show any erros.
Sorry for my english xD and Happy New Year!