I’ trying to pick up arrows on the field.
And I’m using a trigger in front of my character, but for some reason it doesn’t work my way
The code:
var Pickup = false;
function OnTriggerStay (otherObject : Collider)
{
if(otherObject.gameObject.tag == "Arrow")
{
Pickup = true;
}
}
function Update ()
{
if(Pickup Input.GetKeyDown(KeyCode.F))
{
ArrowScript.Arrows ++;
}
}
ok so, I can pick up the arrows. but Pickup is always true, I’ve tried with OnTriggerEnter / OnTriggerExit but then it doesn’t get true at all.
Anyone knows what’s wrong?