How to reference editable entity

My code in a creative device:

@editable Walls : []entity = array{}

How it shows up:
image
Entity I’m trying to reference from outliner:
image

I can’t drag this entity in my scene into the editable slot. Any tips?

I’m not 100% sure but I don’t think you can reference an entity as an editable in a device. As an alternative you could grab the Simulation Entity (root of all entities) in the device then search for the entity you want.

Use this API to grab the Simulation Entity in your device:

    @experimental
    # Returns the simulation entity at the root of the experience this `creative_object` is operating within.
    #   * The simulation entity is the rootmost entity in an experience.
    #   * Fails if this `creative_object` is not operating in a context with a valid SimulationEntity.
    (CreativeObject:creative_object).(/Fortnite.com/Devices:)GetSimulationEntity<native><public>()<transacts><decides>:entity

Then you can search for your entity with a tag:

    @experimental
    @available {MinUploadedAtFNVersion := 2930}
    # Finds all descendant entities including `InEntity` with `Tag` present in their `tag_component`.
    # When querying from the simulation entity, the simulation entity itself is not included in the results.
    # The order of the returned entities is unspecified and subject to change.
    (InEntity:entity).FindDescendantEntitiesWithTag<native><public>(Tag:tag)<transacts>:generator(entity)

Or if you don’t want to use a tag, you can add a custom component to those entities and search by component:

    @experimental
    @available {MinUploadedAtFNVersion := 3200}
    # Finds all descendant entities including `InEntity` containing a component of type `component_type`.
    # The order of the returned entities is unspecified and subject to change.
    (InEntity:entity).FindDescendantEntitiesWithComponent<native><public>(component_type:castable_subtype(component))<transacts>:generator(entity)

There are a couple other ways to search for entities too. Just search for FindDescendant inside of Verse.digest.verse

Thanks for this info, for my project I think I need editables tho because I have a big library of biomes → tiles → walls,floors ,ceilings that would be a big hassle to tag and sort through that way versus just dragging from content browser into their correct slot. Imma just stick with Props for now after a day of messing with scene graph it still seems kinda janky

Are each of these things a prefab? Scene Graph is pretty powerful and good for this kind of situation. If you have a single “tile”, wall", “floor”, etc as a prefab, you just edit it once and drag it into your game. If you want to make a change, you just edit the prefab instead of each instance. In your code you can use the API’s I mentioned above to grab them in bulk without having to go through the hassle of figuring out editables.

In my current system they’re all creative_prop_asset, which I can easily drag into editable arrays. To pull with methods above I would have to make a whole lotta tags and put at least two tags on each entity or reference by name in the script if I wanted to recreate my current system which works much cleaner with props