Structures in structures,

I have a superstructure containing a bunch of structures, I used this so I can pass the reference around easily for the other child structures (that work together as a group in some code) but are individually referenced and updated.

Does anyone know the performance \ best practice?

I’m a traditional programmer so I prefer to pass around as little as possible, (since I’m passing a reference for most of it) I figure a superstructure is fine.

However I’m not sure about this level of details in unreal, is it better to break out the structures or nesting them into a superstructure?

tia

When using these in blueprints, you do pay an extra cost, because there’s an additional “unpack this structure” call for each thing you want to read out.

An alternative might be to make a UObject that you can pass around, that has each kind of structure as a separate property. UObjects are always passed by reference, and this lets you avoid chaining multiple “split struct” accessors at once. There’s still a “read property X” node, of course, so the Most Efficient ™ is to inline all the individual members, rather than pack them into separately grouped structs. Then again, if your blueprint code ends up being called frequently enough that this different matters, maybe it should be C++ in the first place…

Anyway: UObject classes! Not entirely useless!

tyvm, will check out UObject