Problem figuring out how to add currency using prefabs

Evelas 3 months ago in Game Creator updated by Marti (Lead Developer) 3 months ago 3

Hi all,

I recently purchased Game Creator and all the additional modules and been trying to follow youtube tutorials and researched support here but I couldn't find what I was looking for - apologies if I didn't notice that the solution was already in here.

I am working on a project where I want the player to walk up to an object, get a prompt to pick it up, destroying it in the process and adding 1 currency to the currency list in my inventory screen - and all of it is working fine and I got it set up the way I want to but...

How can I duplicate this item and have it placed around my map without all instances of it being destroyed when I pick up the first one like it is now?

Just to clarify, when I pick up the first instance of this prefab, the rest disappear as well and I'd really like to avoid having to duplicate and change the names of all these items as I am planning on having quite a lot of them in my project.

This is probably a very newbie question, with an easy solution but I couldn't find one anywhere. I would be very thankful for any help in solving this issue :) I only have experience in designing levels, models etc. so I barely have any knowledge on this kind of stuff, even though I must say game creator has been very newbie friendly to get me started so far :)

thanks in advance,


Unity version:
Game Creator version:

How do you destroy your gameobject?

I have a similar mechanic and don't have this problem. I use the checkbox at the end of the Actions that says "Destroy After Finishing" and it works just fine.

I finally got it working somehow by setting up a list variable with the items and changing from on key hold to button press.

Now I am having issues being able to save and load properly without the objects respawning - as is right now I can easily loot the objects, get the currency from them but if I hit save and then load the game again the objects have respawned and I am able to loot them once again for even more currency which is a problem in my project as I need a very exact number for a sequence I have planned later on in the game, and like it is now it's very easy to cheese the game by just looting and respawning.. anyone have a good way to go about permanently removing something after it has been looted once? If it matters I am not planning on letting the player be able to go back to previous levels after leaving the areas


Phazorknight answer seems pretty straightforward. I'd recommend creating a prefab out of the scene object. Have a Trigger that calls an Action that is at the top-level of the object (this is important), so that, when the action finishes executing, the object gets destroyed (mark the Destroy After Finishing).

You can then spawn multiple instances of this prefab in your scenes and each one will work independently.

However, if you plan to save the state of the object, you could try adding a Remember Active component. This will allow you to remember the active state of the prefab. You'll need to disable the "Destroy After Finishing" and add a "Set Active" action at the end of the actions list so it deactivates the prefab instance.

Hope this helps!