Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question How to change and save Product name using script in play mode (In Editor)

Discussion in 'Scripting' started by Only4gamers, Dec 19, 2022.

  1. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    312
    Hello there,
    My game has 2 versions, one for the full version and one for the demo. For this reason, I want to change the product name using a script so that I don't forget to change the name before building. I tried this:
    Code (CSharp):
    1. PlayerSettings.productName = prodName;
    But it's not saving permanently, and reverting back to original name once I am exiting play mode.
    How to save this change? Or this code is only supposed to run from editor script?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,917
    ... Are you running this during play mode?

    Any of this core editor stuff should be done outside of play mode.
     
    Only4gamers likes this.
  3. Karrzun

    Karrzun

    Joined:
    Oct 26, 2017
    Posts:
    123
    Only4gamers likes this.