Hi, I have searched around for this question and it doesn’t seem to have a clear answer to it, so sorry I have annoy you guys with this. Basically what I’m trying to do is that I have to a pickup system and inventory, like pubg where you can press a button to show the widget and it will scan items around you. I do a sphere trace(the sphere trace runs on a timer whenever the character move or an item is not there anymore) and then I add it to a list and then the widget grabs a hold of that list to display information. That’s just describing what I’m doing, the problem is that I want to have an unique ID for every item that exist in the game at any spesific time, cause the user can drop items too, and I need a way to make that ID the same for server and clients and also make sure 2 items cannot have the same ID at any given time.
What I’m thinking of is to maybe have a list in the game mode that holds track of all the ID’s, and then generates something that isn’t in that list already, but is that a good way to do it or is it a better way.
PS: The reason I want to do this is just that with the current setup, I have to cast everytime to store the reference and if the character moves alot when the inventory widget is up, there will be alot of sphere traces and looping with alot of casting. I don’t actually know if the ID route is any better, but in my mind, I’m thinking creating an interface only for retrieving that ID and maybe also information about the item(stored in a struct) and then create a map instead to easier and maybe more efficiently finding that reference and either do anything with it or delete it.