Each item has a different script and when picked up they give the player all kinds of bonuses. Some of them even give the player passive abilities such as reflective damage. However i cant just delete the game object of the item, since that will also erase it’s script and yet i still want it to disappear from the view. My way of doing so is by disabling it’s SR and box collider, but i feel like that’s not the best solution…
Search for (C# Object Oriented Programing) tutorials and learn how to use a script (a Class) of another script (another class).
Only 2 solutions I can think of is setting the object as inactive after you pick it up and it provides the player’s bonus.
The other which I personally would rather do, is that you attach the script to an empty/invisible but active game object, and make the object a child of it. Add the object as a GameObject variable to the script and set it to be destroyed or inactive after the condition/bonus has been made.