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

Unity 5: Request for option to stop changing my object names when duplicated

Discussion in 'Editor & General Support' started by oei_crichards, Oct 2, 2015.

  1. oei_crichards

    oei_crichards

    Joined:
    Jun 16, 2015
    Posts:
    3
    There was a change for Unity 5 that forces duplicated objects in a scene to have their object names appended by " (#)". I am aware of the reason behind this mainly being to protect users from animation problems (forum), but I am a designer on a larger project, and I have specific naming conventions in my scenes that do not mesh well with this feature in any way. It is now an additional hindrance to go through all objects I create through duplication (there are many) and manually remove the appended numeric on top of adding my own unique identifier that I would be adding in regardless of this feature.

    I understand the reasoning behind this implementation, so I agree that it should be on by default, but I am begging for the option to turn it off. I know what I'm doing and I take pride in the organization of my scenes, but this is causing me much frustration. If this is not changed I will have to start using a macro to remove the useless identifier myself, but it will still be a lot of unnecessary work that I would rather not have to deal with.
     
    Alabatross likes this.
  2. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    karl_jones likes this.
  3. oei_crichards

    oei_crichards

    Joined:
    Jun 16, 2015
    Posts:
    3
    Thank you very much. I appreciate the response.
    :)
     
    holliebuckets likes this.
  4. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    sorry i just edited my post :)
     
  5. oei_crichards

    oei_crichards

    Joined:
    Jun 16, 2015
    Posts:
    3
    There are definitely many situations where the increment naming scheme is beneficial. However, for me and many others (especially on my team) it turns out to be detrimental and wastes time for us to remove the unnecessary number. And while I could just let it be, it kind of ruins the typical naming conventions we utilize (especially the use of " " instead of "_", which can be sketchy in some situations). So an option in the General Unity Preferences to stop this would be a very welcome sight. But I do understand the original demand for the feature and am still glad that the development team takes notice of the community's requests. Thank you!
     
    holliebuckets likes this.
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    We have also encountered this issue and it actually created a bug for our game.
    In our game, we serialize a scene into a JSON representation, then at runtime use that JSON to construct all the objects needed for gameplay.

    The system works by using the game object name - the name is retrieved and a prefab with the same name is loaded from Resources and added to the scene.

    The problem was that our level designers used to duplicate game objects in the scene when creating new levels; this means that now we serialized game objects with names such as "Bumper 1" into the JSON file, but attempting to load this failed, since there's no prefab with that name.

    The solution was easy for us (maybe you could implement a similar solution): Since all of the objects in our gameplay scene are marked with a special component, we added functionality to that, that runs only while not in play mode in the editor. On the Awake() method for that component we check if the game object name matches a certain pattern (e.g: {TEXT} {NUMBER}) and if so, we chop that off to only contain the name...

    Hope this helps in your particular scenario :)