Im trying to make it so when the player picks one up it counts it until the player collects all three.
Right now it counts if the player presses “E” instead. How could I resolve this?
I think the problem im having now is the counter I have set up counts any “E” input to count as picking up an item even when the player isnt actually picking it up. How could I make I so the counter only updates on actual interactions with the item.
This is what is what it looks like now but if doesnt work and on input counts as collecting the item no matter what. I need it so the counter only goes up when when the player directly inputs the interaction on the item. For example if I stand at the beginning of my level away from items and press “E” the counter still increases.
Well, it looks like you need to move this code to the pickup, and on the pickup have it get player character, cast to the player_bp, and add to the count there. You will want to do something to limit distance, touch would be the easiest because on the item you can have it use “On Event Start Overlap” to do it, increment your count on the player, and finally destroy the actor at the end.
Another problem is that it looks like you’re adding to “Crates left” on the closest “Long Crate” to the player, and then deleting that crate, meaning the change of that variable doesn’t matter. If you want to keep count of things you should store them on your player, game instance, or game mode because those will be persistent.