Fix for deleting actor messes with end overlap?

i have a colision box for items and when i enter it it adds to an variable saying hov many item that is closeand when i leave the colision box it removes 1
but when i pick upp an item the end overlap runs more then once so it messes up the variable! i have tried putting in a delay on the end overlap but then when i run around alot of items it dont register all and messes up again

You might want to check if the actor which is leaving the collision box is actually the player.
To do this, you can either, cast to your MainCharacter blueprint or add a Tag to your character and when it leaves you check ActorHasTag.

i tried checking if endoverlap actor == mycharacter blueprint but i guess thats wrong! :stuck_out_tongue: sorry i am new to this

An actor compared with a blueprints will always return false. Easy way is getting your character blueprint name and from the Actor output on the EndOverlap node, drag a wire and type "cast to ".

okey that works :smiley: thanks alot