Forum rules - please read before posting.

Setting ConstantID at runtime

edited August 2022 in Technical Q&A

Hi,
I was looking for a way to set a GameObject's ConstantID at run time through script (but not saved forever in the prefab just temporary for that scene if that makes sense). I tried looking at the scripting guide but I'm not very good at coding and it kept coming up with errors so I gave up lol.
Does anyone know how to do this? Thank you

Comments

  • An ID is generated by attaching a Constant ID component:

    myGameObject.AddComponent<AC.ConstantID> ();
    

    I don't recommend doing so at runtime, however - the ID system's intent is to provide values that are permanent.

    What's the underlying situation you're looking to solve?

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.