![]() ![]() That’s something you’ll have to analyse further. Alternatively, it might be that your code overrides the value of the field with null. Unless something destroys the slider when the scene got reloaded, the concerning field should still reference the slider. The problem being that Unity seem to scrap / Inspector references when you leave that scene. Worst case scenario I just run a Options scene but I would prefer not to:) I’m just spitballin now but maybe something in that direction would work to always have access to the slider/volume wherever you are in the game? ![]() –The problem I see with this is that I would have to re-design the size of it for every screen and I’m not really sure I know how to do that. Let’s say I want to be able to change the slider value on every screen in the game (not only in the menus).Ī) Create a Slider Script that I place directly on the slider, I make it a Donotdestroyonload and singleton to not have duplicates.ī) I simply SetActivate(False) when it’s not in use.Ĭ) This would make it easy for me to not destroy the slider / needing to reference it again and I could just always SET/GET the volume from the PlayerPrefsController. One more thought, I’m really overkilling this assignment but I got bogged down into it and now I can’t stop. If that is something I’ve managed to isolate what would be the best way to fetch a slider that is the child of another gameobject only through script you recon? I think that when I go back to the first scene the only problem is that I can’t get the slider reference (since that has fallen out) and hence I it just doesn’t work. ![]() I’m quite confident it’s not another scene that is being loaded. Thank you again for the answer I have really been trying to dig. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |