Arrow Pickup

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?

You never set pickup to false again. The first time it is ever collided it gets set to true and then it will never go back to false again.

Use OnTriggerEnter and OnTriggerExit, when you enter set it to true, when you exit set it to false.

I tried that, then it never even got true

Hmm, I shot the arrows through the trigger when i shoot, can that intefere with anything?

ok, When i shoot through the trigger it turns true until it leaves, like it should, but when i go close to the ones on the ground nothing happens

Are you on top of them?

No.

I modded the script now, The script is on the arrows now and looks like this

The trigger box is the item on front of my char, that box is trigger and arrow collider is not trigger. but still doesn’t work

Solved it, Had to make the trigger box Kinematic

Hi Skitfet. Could you help me out with aiming and shooting arrows ?