How to save an added tag
-
I just added a tag when in game.
So I have a collision this collision add a tag everything works fine. But I don’t know how to save the tag it for when I restart.
I tried to save the object in an array. But it doesn’t work. I think that the tag that was added during the game cannot be saved in the array?How do you manage that?
How do you add a tag in game and save it for when you restart for example?
-
- You need to save and load the array.
- When loading the array, you must reapply the tags.
Let's start with saving and loading.
After modifying the array (it should now contain all the tags you need), you can trigger the Modify Save File behavior and save the entire array. When the scene starts, you can trigger Load from Save File with the same key you used in the modify save file behavior.Now you can load the array, but you must add the tags back, otherwise all the work you did for saving and loading was for nothing. Grab the loaded value from the load from save file behavior, and plug it into the Modify Tag behavior. There is an option to set the tags of the object (or append tags) which takes in an array.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login