How to go about making an item system for my game?

Im working on a game in which you play as a robot inside of a factory, and you go around solving puzzles to make money and get upgrades and explore more of the factory. The main mechanic of these puzzles is being able to pick up item’s and place them down, one at a time. So far i’ve tried using the CollectionService and using tags (Haven’t gotten a fully working system for that yet even.)

Im not sure if thats the best way of going about it, and so far my code for that system seems quite unoptimized.

So, what other ways could i go about doing this? So far i’ve thought of

  • OOP (Not fully educated in this yet)
  • CollectionService/Tags (Already attempted twice and failed both times)
  • Idk lol

Also, to be specific with what im wanting to make:

  • The items can only be held one at a time above the players head
  • There are ItemHolders that the player can place items on/in that can detect what item is being held as well as limit what items can be held
  • Items can function while held (e.g. having a spring item that makes players get launched upwards when touched, and still works when held by a player).

Any help would be GREATLY appreciated, as this is probably the most important mechanic for my game!

1 Like

Tbh I would have every item be on the robot at all times (just invisible) and then once you pick it up it becomes visible and the item in the world becomes invisible.
Use a string or number value and give each item an ID or use object values to determine which item it is.
(Honestly I’m not an expert lol)

Could work, but id much rather prefer if they were not just loaded constantly on everything that could hold an item, as that could be laggy and could be hard to deal with. Id also want any info from the objects that were picked up to transfer over when picked up/placed down.

Hopefully someone has an idea, this is like the first game ive actually been motivated to make and i hope it doesnt get stopped because i cant figure out this simple of a thing…