Search Unity

Help with Reboot of project, Hierarchy questions.

Discussion in 'General Discussion' started by rozgar23, Feb 27, 2021.

?

Best Hierarchy approach to avoid conflicts; scripts, errors and all future problems?

Poll closed Mar 29, 2021.
  1. Use One Scene Two Canvas

    0 vote(s)
    0.0%
  2. Two Scene One Canvas

    0 vote(s)
    0.0%
  3. One Scene One Canvas Two GameObject

    0 vote(s)
    0.0%
  1. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    Im planning on Rebooting my project for the 3rd time, Fresh Unity 2020.2.6f1 Simply that version, cause of its integration with Bolt so i can script easier for Unity Ads Reward Buttons :)

    I would be very happy to hear about building hierarchy ideas.

    This is what i have at the moment, one scene ---> Canvas ----> two GameObjects <LanguageSwe> and <LanguageEng>
    Each of those GameObjects have similar pages, buttons, sprites, sound files and text.
    Planning to implement Reward video bolt visual scripts or called Flow for many pages.

    upload_2021-2-27_4-26-6.png

    It's an app for Learning Kurdish Language, there are two languages
    ppl who know english choose english on the menu to learn kurdish,
    ppl who know swedish choose swedish to learn kurdish.

    Ive already had my first release 2021 feb including Admob, and updated 17 feb with English added.

    Cause of later build errors that i couldnt solve without new errors i decided to fresh start again.
    -----------------------------------------------------------------------
    My question now is this the way I should go for the Hierarchy? Are my Canvas settings correct?
    "simple app for android"

    or

    Have Two Scenes?

    or

    Have One Scene Two Canvas?
    ----------------------------------------------------

    More about my project, i plan on having as said earlier on PageLearn123
    1-10 numbers you can learn
    11-20
    21-30

    up to 100 numbers in 10 groups each activativated by watching Reward ad button, after one viewed reward ad"button" you get new 10 new number and a new reward button to activate next 10 numbers, this i have solved using Unity Ads and Bolt Visual script. i did this before i ran into build issues my last couple days.
    I give this info so that i get the right knowledge, i shall appriciate all answers i can get.
     
  2. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    You should look into how video game localizations are done.
     
    angrypenguin and rozgar23 like this.
  3. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    I wish to release the app with all Langauge options included.
     
  4. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    What I meant by that was that there are ways of building your interface to support multiple language options without having to duplicate everything. That seems...tedious and unnecessary.
     
  5. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Wouldn't this be done easier in xamarin or similar. If you don't use 3D or 2D capabilites in a game like capacity
     
  6. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    And really not performant as well
     
  7. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    Make sure, you game replaces just values of strings in your menu. As pointed above already, don't duplicate everything.

    You may need some local data base storage, for different languages. JSON, XML SQLite etc. all would work fine, and allow not only extensibility but also easier to maintain and quick bulk translation to other languages.

    If you make it right, you would be able modify languages even after game is built, rather than using Unity editor.
     
    rozgar23 likes this.
  8. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    I am a new unity user, only easy option for me so far has been duplicate.

    Abort your advise about how i should för the language thing.
    Is there Any tutorial you could please tell me.

    That works for unity version 2020.2 cause i need Good Bolt compability without Ludiq errors.

    I appreciate the help i get.
     
  9. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    Im a new unity user like since january 28 2021
    Could you advise me in how to build interface or any tutorials that would be compatible with unity 2020.2, im using Bolt for untity rewarded videos cause i got some red errors cause of Ludiq with unity 2019.20 , i would be most most grateful.
     
  10. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    If you have issue with an assets, you should speak with its vendor.
    Or try different compatible Unity version.

    If you are new to Unity, there are plenty steps to learn.
    I am not sure if there is any particular tutorial, which good what you want.
    But if I were you, I would simply look for anything with multi language support.
    On other hand, I would look for anything, which is related to data driven design.
    Studying second, will probably teach you about organising your project.
    But many things, may require you out of the box thinking.
    You will most likely need do some scripting, rather than just copy paste game objects into the scene.
     
    Last edited: Feb 27, 2021
  11. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    I am appreciate your response. I began my journey in jan 19th of 2021.
    I learned Adobe Flash CS6 after 2 apps made but still not satisfying results and the Adobe AIR hassle i jumped to Unity3D end of jan, i got One Released App on Google with admob banners, interstial and got a second update on feb17 with extra language. Along the way using Unity i had to delete my projects many times sometimes reinstalling my windows 10.

    even though I research a lot, I cannot find answers corresponding to my project. But Right now I am using an Language
    Lean Localization asset made by Carlos Wilkes. I am doing test runs right now.

    Still I don't know best Canvas Settings for my project, I do want to run 1920x1080 but there is so many different guides that suggest other weird resolutions and so on.

    On my SubPages in Hierarchy i sometimes do get this weird issue, Anchors on that object, image, text wont stretch all out to the corners of the screen, havent noticed any problems on release though.

    I also am worried about doing all over again on 2020.26f1 and it might still end with errors.
    I use Bolt, Ludiq for Unity Rewarded videos and i find it very easy cause my brain wont learn coding.
    I find Bolt to be working better on 2020.2 then the one I had last 2019.20
     
  12. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    @rozgar23 be aware of falling into shopping spree on the asset store.
    It is the easy trap and cash grab for newbies like yourself.
    You will hit naturally many issues with them.
    And with limited expertise, you will have really hard time to resolve them.
    So again, be very aware.
     
    rozgar23 likes this.
  13. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    Unity has a localisation package, you don't even need 3rd party stuff.

    Basically, you put all of your writing and language specific images in a list, and add them to your scene by their ID in that list. Then to change languages you just tell it to use a different list, which can be done at runtime.
     
  14. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    upload_2021-3-1_8-53-48.png

    Where can i find it :/
     
  15. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    If anything there is search bar on top.
    But you need actually look into package manager. Mind, not in project settings.
     
    rozgar23 likes this.
  16. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    It seems that it changed since 2019.4. Here's updated documentation, but do note that I found it by clicking the big "View Latest Version" at the top of the page I linked you.
     
    rozgar23 and MadeFromPolygons like this.
  17. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    Got it! Thanks!

    I just installed it, mind if i ask if this works with Text Mesh Pro or should i Stick to Usual Text form Unity?
     
  18. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    It works with text mesh pro
     
    rozgar23 likes this.
  19. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    Sir! With all due Respect, i looked into this Unity Built in Localizer tool and frankly im stupid, even reading the dummies series.

    I will never get my project going this way, i decided for a stupido as me only choice i have is Doing 2 parent folders one called LanguageSwe and other LanguageEng with exact same Layout and all only differ would be the texts.

    I really need this one question answered, Should i do;

    Canvas ---> LanguageSwe
    ---> LanguageEng

    Or Canvaz ---> LanguageSwe
    Canvaz ---> LanguageEng
     
  20. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    I dont understand the question, but probably should do neither. Duplicating like this is just plain wrong, the right way to do this is not to do something wrong on purpose because you dont understand. Game dev is not a quick easy thing, you need to spend some time getting to learn the localisation system. You arent just going to look at it and immediatly get it working in 10 mins.

    Here is a tutorial on how to get it setup: https://phrase.com/blog/posts/localizing-unity-games-official-localization-package/

    Follow that and then come back once you have completed it if you have any questions.
     
    Antypodish and rozgar23 like this.
  21. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Dude you have 3 things in your program, data (the texts) layout (the UI) and behavior (code). Your problem needs to be solved in the data part of these 3 (And some code to hook up correct data depending on selected language).
     
    MadeFromPolygons and rozgar23 like this.
  22. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    Yes, what @MDADigital is saying basically. Instead of duplicating the UI and code, you just need to swap out the data.

    That turorial I linked, shows you how do to that. Essentially the localisation package allows you to define what text and languages and fonts etc to use for each language (the data) and then allows you to link that to the UI you are using, so that you can sensibly and efficiently change. This means adding or removing languages later on will be easier, and that if you get bugs you dont need to fix in 2 places each time.
     
    Joe-Censored, MDADigital and rozgar23 like this.
  23. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    I have dived into it, speaking of the fact i havent slept last night, i will see how this goes. Also this disturbing girlfreind that wont go to work just yet. "nah she is sweet but still omg"
     
  24. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    Haha, well good luck to you :) But make sure to rest too, sleepy work is often bad work :)
     
    Antypodish and rozgar23 like this.
  25. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    After a Good 1-2 hours sleep i finally figured out, what to input here at the inspector on the Actual Text file.

    upload_2021-3-1_17-9-39.png

    Still there is one thing i am worried as of compability to this project.
    I do have around 100 buttons with words, sentence etc.
    And around 20x 20-100words texts novels in different pages.
    Will i just like icarus get burned by the sun?

    Im trying to find out how to change language while running on phone with Button_flags and what about Raycasting on objects?
    Should i go with the optimazation tips from ppl to turn of raycasting on text and other objects?

    upload_2021-3-1_19-12-0.png
    View attachment 805793

    View attachment 805700
     
    Last edited: Mar 1, 2021
  26. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    As already said, don't try develop, without good sleep. It is counter productive. You may be able do it for short time, but soon you will hit deprivation and continuous tiredness. Eventually hitting frustration of unable focusing, problem with understanding bits you try to learn and resulting demotivate. Don't assume you are super hero, who can run without sleep and be proficient. It just don't work like that.
     
    MadeFromPolygons and rozgar23 like this.
  27. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    I started using Unity for my first time 2021 Jan 29 with no coding or design, game knowledge.

    After 10 project fails red errors, uninstalls of unity, re-installs, uninstall of Windows10, a lot of testing on side projects opened at the same time, 100 guides and tutorials from anywhere.

    I had a first release 10th February 2021 with Admob and started to developing to one more language from 15 feb and on 17 feb released including English and swedish.

    Along all the time going i had other things to attend to, my young brothers, relatives and sweet annyoing girlfreind.

    Im releasing full story on how my days were hehe

    here is my dev page if you wanna check my app for flaws: https://play.google.com/store/apps/developer?id=RozaCorp
     
  28. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    30min Later I managed to make my clickable button Flags to switch the language.

    what finnally worked was in asset folder (Localization Settings.asset)

    upload_2021-3-1_20-2-19.png
    Check that mark*

    And then

    upload_2021-3-1_20-4-47.png
     
  29. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    Why did you mark the localization settings as addressable? What problem did that fix?
     
    Joe-Censored likes this.
  30. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    When unchecked, pressing the flag or lets say button.
    The language in editor wouldnt work on editor or on phone.

    When checked, it works in editor but not running on Phone.

    upload_2021-3-2_21-14-6.png

    I only checked these blue one

    upload_2021-3-2_21-21-4.png
    Maybe if i Check those two in red as adressable it will work on phone?

    I am very new to Unity, very...

    So don't get annoyed for my wrongs here haha :)
     
  31. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    You should not change any of the Localization Asset Addressable settings unless you know what you are doing ;)
    You certainly don't want to make the Localization Settings Asset Addressable, that should be part of the build.

    If you want to change the locale you could do something like this:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEngine.Localization;
    4. using UnityEngine.Localization.Settings;
    5.  
    6. public class Example : MonoBehaviour
    7. {
    8.     public LocaleIdentifier locale;
    9.  
    10.     public void ChangeLocale()
    11.     {
    12.         if (!LocalizationSettings.InitializationOperation.IsDone)
    13.         {
    14.             LocalizationSettings.InitializationOperation.CompletedTypeless += a => ChangeLocale();
    15.         }
    16.         else
    17.         {
    18.             LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.GetLocale(locale);
    19.         }
    20.     }
    21. }
    22.  
    Add this Script to each button and hook up the button to call the ChangeLocale event, then set the Locale in the property.
    We also have a dedicated forum section for localization https://forum.unity.com/forums/localisation-tools-previews.205/
     
    rozgar23 likes this.
  32. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    It is Strange, unchecked now and it works on editor havent tried it out on the phone at the time.

    Maybe it was the onclick mouse event i didnt do right from start.

    But i've noticed some yello errors on Localization Analyze.
    upload_2021-3-2_21-38-13.png
     
  33. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    Yes its because you are referencing the Addressable assets directly, They are built into Asset Bundles and should not be referenced directly in a scene or you will end up with duplicates. Use My example and you wont need to reference them.
     
    rozgar23 likes this.
  34. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    "I also noticed a Apk size increase when checked haha"

    Sir, i have to say.
    It's an Honor to get replies from Unity Technologies Team
     
    karl_jones likes this.
  35. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    I been looking around the internet and the Localization guide for info of what exacly these buttons do but cant find any intel. Do you mind givin me some more knowledge :)

    I mostly think of if there is something im missing here everytime i use same Default Build button, am missing something that i should do to prevent future errors/Size increase?
    upload_2021-3-4_22-25-50.png
     
  36. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    rozgar23 likes this.
  37. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37

    So plain simple, its safe to Press clean build, then default build before transfer to Phone?

    I have like over hundreds translations dont wanna do mistakes :)
     
  38. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    Yes thats fine.
     
    rozgar23 and MadeFromPolygons like this.
  39. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    Back it up!
     
  40. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Even better, version it!
     
  41. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    Back it up?
     
  42. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37
    Version it?
    version it?
     
  43. Yes.
    Yes.
    Yes.
     
  44. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    Make a copy of it so that if something goes wrong you still have things how they were. If something is important then you should be doing this regularly.

    Data can be killed by pretty random things, which you sometimes have no control over. A power cut during a save could kill a scene file, for instance. Many people let it happen and then blame their software. Whether you agree with them or not, dead data is dead.

    Version control is even better. It keeps a full history of all changes you make to a set of files. So you get a backup, plus "infinite undo", plus documentation, plus ease of sharing within a team, and other cool stuff. So do learn about that at some point.

    But take things one step at a time. For now, making a copy of your project will cover your biggest risk and doesn't require much learning or any special tools.
     
    rozgar23 likes this.
  45. rozgar23

    rozgar23

    Joined:
    Feb 1, 2021
    Posts:
    37