Download

Array of objects in blueprint

Hi, Guys!

I’m trying to create maze generation blueprint. I want to have something like array of objects to store my maze cells and walls.
So i anyhow need to create custom object type and i see no possibility to do this using blueprints. I found structure blueprint type but can’t understand whether i can use it for my purposes and what it exactly is, it seems they have no enough info about that in docs.

So i need something like an cell object, that has for example several properties:
wasVisited - boolean,
neighbours - array of links to other cells,
walls - links for walls actor objects, for each direction (north, south, east, west),
cell - link to cell actor (floor plane)

How i can create that programmatically and operate it’s properties inside blueprints?

Thanks.

Each Actor/Blueprint/Widget is in itself its own custom object type as you say. The variables you create inside of them are properties of that class.

With that said if you wanted you could create a new ActorBP that is called Cell and add all the relevant properties to that Cell class and there you have it.

A Struct or BP Structure is similar to a Class, it holds data in the form of properties. It would make more sense for you to use a Struct to create a Cell and then have a seperate BP that generates the Cells and populates them with data.

Hi, Thanks for the decent answer. Yep i see, we can use empty blueprint (or not empty but with any actor n scene, floor itself for example) with some properties, or create structure blueprint.

So, i have cell structure blueprint now. But can’t understand what happens when i update strcuture properties using set members in strcuture (in cell) function.

I have array of structures (cells), when i try to update properties using that set members in function it seems it doesn’t update array element itself but create new virtual variable that being updated.

Do i need to update array element itself?