100 references?

If I have 100 items on a level and at some point they need to get a value from the player (ie. when a player is trying to interact with it), would referencing the player BP at the start load 100 references of the player into the memory or do they all share the one reference as there is only 1 player BP class?

I’m trying to work out whether to cache a reference to the player in my item BP class at the start (Begin play) or use casting or an interface when it’s needed. Thanks.

no, but caching a reference to anything in 100 different items is usually a sign that you can design that better.

If the thing you need to do is in response to the item being interacted with, then get the reference for the player/whatever character is doing the interaction at that time. Certainly, if the player is interacting with the item, then I would expect there to be a pointer to the player doing the interaction at that point.

1 Like

Thank you!