Good to see a channel with new content! I used this in my game and it works great for keep track of my player's coins between scenes, even once you exit the game if you wish.
Awesome tip! One deficiency though is that if you want to load a scene that doesn't require it and then switch back to another scene that DOES require it, unity might have garbage collected it. At this point is it best to just commit the value to a file, or is there a workaround other than requiring the object in every scene?
Thanks for the feedback! Yes in general we would need a High Level save object attached to every scene that has in turn references to all the other data and probably we could access this HL object in our code instead and ask it for the data that we need. Sorry about not explaining that. It is not easy to explain everything in shorter tutorials.
how to persiste TExt componentes? in btween scenes? I need to pass the Text as welll (not only the data)...I need a starting point to every level , in every level I need some kind of thing to start eeverylevel to find text and avoiding Null reference in real time.
Unless you have a lot of data the best approach is to use Player Prefs to persist data between levels. So are good if you remember to keep a references to the ones containing required data in every scene. For persisting data between sessions I like to use JSON serialization and just save that to a file but you can do any form of serialization docs.unity3d.com/2020.1/Documentation/Manual/JSONSerialization.html
Someone help me , just logic stuff. I plan make simple 2d like mario with scoring and has multiple levels. My problem is the leaderboard and its level selection. I would want to place the highest score of players on the board. but the problem is how? Like i have multiple levels, so i do this?: 1.If i have like a level selection for ex level 1, it will get the highest score data i make and send it to level 2 then keep getting high score to reach for ex level 10 but the issue is level selection, what if i just restart different levels via level selection like i restarted level 2 and level 5 so the data changed right ? How do i keep tallying that like to the current level i had completed is like level 20. 2. For low levels (level 1-40)keep the scoring thing to a minimal like just increase 10 points. But at later higher levels make the scoring thing higher is this the right thing? Someone help me. Thanks.
As long as the scene has a reference to an SO it should not be unloaded. The moment the scene has no connection to the SO it is unloaded from the memory.
Hey! Thanks for watching! The solution with creating a general context scene "Game" and loading additively other scenes is a more generic way to deal with issues like shared code etc. SO are a cool way to deal with those issues but at the same time its Unity specific solution. I try to always keep it in mind that using SO means trading generic knowledge for Unity specific one.
@@SunnyValleyStudio Btw do you have any videos about that topic of additive scenes or can you guide me into any resource on that topic, I cannot find much about it - many people mention this, but no one explains how to do that with some examples :(
@@DrakonFirestone Yeah am planning a video about it. Right now a great way to learn about additive scenes is by checking the Unity Open Project unity.com/open-projects
hey I used SO to save my float values. I build the game to my phone and tested it. When I restarted the scen(with a button) the values did not go deleted but when I closed the app and opened it again the values were gone(reseted). But in Unity editor this did not happy when I played the game and closed it the values did not go. please help thanks
Hey! This method is only useful for persisting the value between scenes that actually reference this SO. When you close the app the value is gode by design. Use SO only to decouple your UI from other things. Use Json or some online database to to actually save the state of your game. If by any chance the SO doesn't persist the value between scenes just use PlayerPrefs to store it although it should not happen.
this is good information but u gotta breath between your sentences when u talk m8. This is truly hard to follow. It's like an atomicbomb with information thrown at u all at once.
Sir. Thank you very much, I have been searching a lot of time in UA-cam but I got them in your video..❤❤❤
Glad to hear it! 🙂
Good to see a channel with new content! I used this in my game and it works great for keep track of my player's coins between scenes, even once you exit the game if you wish.
Great to hear that! Thanks for watching 😉
Finally someone made video on this thnx.
hi,
Kindly make more videos of unity challenges n other projects/tutorials for beginners
Thanks
Thanks for watching!
Awesome tip! One deficiency though is that if you want to load a scene that doesn't require it and then switch back to another scene that DOES require it, unity might have garbage collected it. At this point is it best to just commit the value to a file, or is there a workaround other than requiring the object in every scene?
Thanks for the feedback! Yes in general we would need a High Level save object attached to every scene that has in turn references to all the other data and probably we could access this HL object in our code instead and ask it for the data that we need.
Sorry about not explaining that. It is not easy to explain everything in shorter tutorials.
Thank you for this video! Works amazingly!
Good to hear ! Thanks for watching 🙂
Great video helped me a lot but something is not working for me when I try to save a 2D list do you know of any problem?
Strange. Maybe because List is reference type so it is connected with SO but not stored in it? I will do my best to test it
It's good to see scriptable objects era..
Thanks for watching!
I believe that SO can improve the code behind our games. The only downside is that the code becomes a Unity specific solution.
im having this error : The type or namespace name 'FloatSO' could not be found (are you missing a using directive or an assembly reference?)
in my script where im accessing my SO
Can you confirm if your script "FloatSO" has the file named the same way? It usually ends up being issue with the names
@@SunnyValleyStudio yes I will
how to persiste TExt componentes? in btween scenes? I need to pass the Text as welll (not only the data)...I need a starting point to every level , in every level I need some kind of thing to start eeverylevel to find text and avoiding Null reference in real time.
Unless you have a lot of data the best approach is to use Player Prefs to persist data between levels. So are good if you remember to keep a references to the ones containing required data in every scene. For persisting data between sessions I like to use JSON serialization and just save that to a file but you can do any form of serialization docs.unity3d.com/2020.1/Documentation/Manual/JSONSerialization.html
Someone help me , just logic stuff. I plan make simple 2d like mario with scoring and has multiple levels. My problem is the leaderboard and its level selection. I would want to place the highest score of players on the board.
but the problem is how? Like i have multiple levels, so i do this?:
1.If i have like a level selection for ex level 1, it will get the highest score data i make and send it to level 2 then keep getting high score to reach for ex level 10 but the issue is level selection, what if i just restart different levels via level selection like i restarted level 2 and level 5 so the data changed right ? How do i keep tallying that like to the current level i had completed is like level 20.
2. For low levels (level 1-40)keep the scoring thing to a minimal like just increase 10 points. But at later higher levels make the scoring thing higher is this the right thing?
Someone help me. Thanks.
does this works even if you reload the scene
As long as the scene has a reference to an SO it should not be unloaded. The moment the scene has no connection to the SO it is unloaded from the memory.
I can't make a game without using So, they are a game changer when you unlock their power
Hey! Thanks for watching!
The solution with creating a general context scene "Game" and loading additively other scenes is a more generic way to deal with issues like shared code etc. SO are a cool way to deal with those issues but at the same time its Unity specific solution. I try to always keep it in mind that using SO means trading generic knowledge for Unity specific one.
@@SunnyValleyStudio That's a good point about it being Unity specific, definitely don't learn them until you can do it another way first.
@@SunnyValleyStudio Btw do you have any videos about that topic of additive scenes or can you guide me into any resource on that topic, I cannot find much about it - many people mention this, but no one explains how to do that with some examples :(
@@DrakonFirestone Yeah am planning a video about it. Right now a great way to learn about additive scenes is by checking the Unity Open Project unity.com/open-projects
The Wharf person I have to get the chance that bot for a bit better but not sure how long have to get the chance that bot for a bit better
hey I used SO to save my float values. I build the game to my phone and tested it. When I restarted the scen(with a button) the values did not go deleted but when I closed the app and opened it again the values were gone(reseted). But in Unity editor this did not happy when I played the game and closed it the values did not go. please help thanks
Hey! This method is only useful for persisting the value between scenes that actually reference this SO. When you close the app the value is gode by design. Use SO only to decouple your UI from other things. Use Json or some online database to to actually save the state of your game.
If by any chance the SO doesn't persist the value between scenes just use PlayerPrefs to store it although it should not happen.
@@SunnyValleyStudio oh ok
this is good information but u gotta breath between your sentences when u talk m8. This is truly hard to follow. It's like an atomicbomb with information thrown at u all at once.
Thanks for the feedback! I definitely need to work a bit more on my delivery.