Is there a way to set the name tag of a scene object component without setting up a unique scene object in the system? I'm assuming adding a text code might do something like this? Or is it possible to maybe make some kind of custom script that can provide a name of my choice?

image


image
  • Probably best using custom text codes - set one up in UI > Text Codes and use the Scene Object component's text codes to override it (i.e. using same text code here).
    That way you can use it e.g. in a HUD, displaying the scene object's content of the text code.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited February 28
    Not quite sure if I follow. So I need to make a new entry in the UI Text codes that overrides a scene object Text Code? In my case I just want to change the name so should I use "name" as the Text Code? So from there should I just add the new Text Code to the scene object so that it overrides it?

    image

    image
    Post edited by AustinGreear on
  • Close, but no - you can't use something that most likely is used as a standard text code somewhere (e.g. < name> is often used). Change that to something like #name or < customname> (without the space after < ).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Oh I see, but if I do that I would have to change the text code the HUD is associated with as well wouldn't I? Currently I use < name> for the HUD but i would have to swap it out for the custom name in this case. The only thing I want to do is just give the scene object a different name.
  • Simple fix for that: Use the custom text code as the name of the scene object.
    It'll be replaced whenever the scene object's name is used somewhere.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Sorry, I still don't think I quite follow. You mean replace the name of the scene object itself? Is there a way to do this possibly with a custom script? I feel like it would be easier/more direct that way. From what I noticed in the Makinom source code the HUDComponent seems to be getting some kind of component from the gameObject itself. Is it possible to just make some kind of script that provides it with the data I want?
  • edited March 5
    No, just set the Name setting of the scene object (in Game > Scene Objects) to use the custom text code.
    E.g. if your custom text code is #name, set the name in the settings of the scene object to #name.
    That way you can use the regular name of the scene object in the HUD and it'll use the custom text code as it's content, replacing it with whatever content you define for it.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I got it now! Thanks for putting up with me lol
Sign In or Register to comment.