Getting data from a struct of structs?

Hey, I have a struct with this data:

Struct LevelsSetup:
Name: DataType:
Level0 LevelData
Level1 LevelData
Level2 LevelData

Struct LevelData:
LevelType LevelTypeEnum
CorrectTiles Int

So it’s a struct of a struct. I want to create a function that takes a variable CurrentLevel and then breaks out the data for that level (e.g LevelSetup->LevelData->CorrectTile), but I’m stumbling a bit.

I was thinking I’d be able to do a ‘Select’ on the LevelsSetup struct to get Level0’s LevelData but it only gives me option0 and option1. ‘Set Array Elem’ doesn’t seem to help either, was thinking I might be able to set a certain index of the LevelsSetup into a target LevelData array but no luck.

Does anyone know how to do this? I could break LevelsSetup and then break LevelData and do a massive case: situation but that seems silly.

Thanks in advance.

The easiest way to do it is to SetMembersInStruct:

Select any SetMembersInStruct node and expose embedded members. I hope I understood you right; somehow I feel I did not.

When it comes to Select node, you can add new pins by RMB–>Add pin.

Thanks, I don’t think that would work… here’s an image of what I’m trying to do (my description of data in my first post was a bit off). Imagine I can get an index of the first struct that’ll output structX… hope I make more sense now. :slight_smile:

In that case, you could use either an array of level structs or a select node:

Aah, I had it in front of me all the time haha… great, thanks a bunch!