Forum rules - please read before posting.

Issue with Constant ID generation in Unity 2021.2

edited August 2021 in Technical Q&A

Hey Chris,
Although 2021.2 is in beta- I've been experimenting with the new versions as it fixes a number of issues with timeline.

However, I've found that when opening an existing project with AC, the console is spammed with messages saying the Constant IDs for objects in that scene's hierarchy are being created:

The issue is that the constant IDs for things like Unity UI objects change, but aren't updated in the Menu settings in AC Game Editor.

This then means that all of those UI elements don't respond when entering play mode and it will throw null reference errors.

However, I've found that if I go to another scene and enter play mode it will fix the issue. It's an odd one, but one that I've been able to reproduce several times.

Comments

  • Thanks for the heads-up.

    Are you referring to "Unity UI In Scene" menus, or "Unity UI Prefab" menus, and can you share the exact message being spammed in the Console? I want to be sure I'm recreating the same issue as yourself.

  • They're Unity UI in scene menus. Pretty much any UI element I have in the scene hierarchy has a new constant ID set.

    I've just run-through it again, and it does it every time. Steps to reproduce:

    • Quit Unity while in a scene with Unity UI objects in the scene and constant IDs assigned to them
    • Open the project and it will load the last scene you were in
    • The messages in the console appear like above
    • Try to enter play mode and you'll get null reference errors and none of the UI elements will respond

    The only way I've been able to fix the issue is to:

    • Open another scene in the same project and enter play mode
    • Exit play mode and go back to the scene that had the issue
    • The constant IDs seem to update and everything is back to normal
  • Thanks, I'll look into this and let you know if I need any more details.

  • I'm afraid I'm not able to reproduce any problem with In-Scene menus in the latest beta.

    Would you be able to PM a .unitypackage with a Menu Manager and sample scene that has the issue?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.