How do I get the UID of an 'Object Created By name'

0 favourites
  • 3 posts
From the Asset Store
Act on your instances, get/set their properties and variables only thanks to their UID. No more picking trouble! Plugin
  • I am using 3 Families: SelectableObjects, Units and Buildings. Each Object in the SelectableObjects Family is either in the Buildings or Units family as well.

    When I create an object by name, e.g. "House", How do I get the UID as I didn't think the Families would be populated immediately.

    - Frink

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can create a sub-event with this condition:

    System Pick last created Buildings

    Then you can get Buildings.UID

  • Thanks dop2000, that does work

    For anyone else having trouble, it seems that the object only gets added to the Family immediately when you do a Pick Last Created on that family.

    So:

    Create object by name, "House"

    Pick Last SelectableObjects

    Works as expected, SelectableObjects.ObjectTypeName = "House"

    But:

    Pick Buildings where Buildings.UID = SelectableObjects.UID

    Doesn't work, nothing is picked

    This does work tho:

    Pick Last Buildings

    if Buildings.UID = SelectableObjects.UID Browser.Log Buildings.ObjectTypeName

    Logs "House" in the Browser

    Hope that helps anyone as confused as me!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)