I’ve created this blueprint that checks to see if a player is overlapping its collision component and if the player overlaps the component then they are able to pick up the blueprint/object in the game. That works fine but the problem occurs when i place more than one instance of that blueprint into the game world and as i overlap the component of one of the blueprints at random, i am not able to pick up the object, instead i am forced to look for the last placed instance of that blueprint and upon finding an picking up that last instance, i would have to find the second last instance placed which becomes the last placed instance and this goes on until there is no instance of that blueprint left in the world. Any help would be very much appreciated. Thanks in advance. Link to the problem shown on video: - YouTube
Blueprint actor forces player to interact with last instance of bp placed before interacting with other instances
I had no issues interacting with specific instances of a blueprint. This may be related either to your blueprint script or the method you are using to spawn the items. To test this I used the third person template and followed these steps:
- I opened the character blueprint and created an actor variable and named it “Actor”
- I then created an actor blueprint called “Item_BP”
- Inside the blueprint I added a sphere component and a collision component.
- Then created the following script in the event graph:
- That will assign the correct actor to the character when he overlaps the sphere collision
- Next I added this to the character so that when I pressed “E” it would destroy that sphere
- I then added several of these actors to the scene and could reliably destroy the one I was standing next to. It didn’t matter what order they were created.
- I then tried spawning the actors via the level blueprint durring runtime to see if that had any effect. I still had no issues.
Let me know if I missed anything in my test or if I was able to help you out!
Thank you very much that worked perfectly and was way more simple than mine.