Search Unity

Question How do I change PlayerSettings > Package Name from code?

Discussion in 'Scripting' started by exedevelopment, Jan 26, 2023.

  1. exedevelopment

    exedevelopment

    Joined:
    Jul 9, 2022
    Posts:
    2
    Hello,

    I tried:

    string product = "<product>";
    string company = "<company>";
    PlayerSettings.Android.packageName = $"com.{company}.{product}";
    // 'PlayerSettings.Android' does not contain a definition for 'packageName'

    How can I modify Project Settings via scripting? – Unity
    -> I think I need to Serialize PlayerSettings.asset if that exists somewhere, because I didn't find it anywhere.
     
  2. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,065
    Imm0rt4l_PL and exedevelopment like this.
  3. exedevelopment

    exedevelopment

    Joined:
    Jul 9, 2022
    Posts:
    2