Hi, I’ve been working on a game recently and I need some help on how to make a collectable system similar to the moons in Mario Odyssey, or the Jiggies in Banjo-Kazooie. So far, All i,ve managed to do is make the sprites for the collectable.
I’m not sure what you’re asking.
You can use variables to keep track of the amount of stuff you’ve collected.
Yeah, I know, but my problem is that I don’t know how to make it that once a collectable is collected, it doesn’t show up again.
Give the objects their own Boolean variable, InCollection. When you collect the item, turn the variable on/true. And in another event, check for “if InCollection = true”, then the action could be to delete / destroy the object.
I’m not at my pc rn but that’s how I would try to do it. Maybe there’s an easier way but you can start with that.
Ok, but quick question. Do object variables apply to an instance of an object in a scene, or all instances?
When you place an Object on the scene, it creates an Instance of that object, like a clone. The Object variables apply to each Instance. So if you collect one Instance of a coin, for example, it’ll count just that one coin. But all instances will carry that variable that you can check.
I did a real quick test and this worked for me, ymmv:
Thanks for the help. Will credit.
I have another question. Is there a way to connect this to a child variable, for have multiple save files?
Thanks for the help.