Hello,
It will be really nice to be able to split a struct data output into individual variable data output like one can do in Unreal Blueprint.
https://dev.epicgames.com/documentation ... eal-engine
Because sometimes we are only interested in certain variables in a struct, but don't want to explicitly write a compute component to just to access them from the struct itself. I believe it will save a lot of time in general.
One usecase I have is whenever an AI is attacked, a Damage event is triggered and it passes in a `DamageData` struct.
Inside `DamageData` stores the damage amount and the aggressor/attacker.
My AI logic will set an "Opponent" variable to reference DamageData.Attacker.
There are two ways to achieve this in Unreal:
1. Splitting struct output ports directly
2. Using a Break Struct node (this is probably the easier option?)
For option 2 I can probably write a custom evaluate component to split the struct into variables, but that will be a lot more extra works and code to maintain.
[Feature Request] Having the possibility to split variables in a struct as individual output port
-
- Posts: 17
- Joined: 2025/03/29 09:07
- caitsithware
- 管理人
- Posts: 133
- Joined: 2024/03/26 01:56
Re: [Feature Request] Having the possibility to split variables in a struct as individual output port
Hello,
I have already made a note of field splitting as an issue to consider.
Taking user-defined types into account will require the use of the script generation function, so I am considering option 2, but since an equivalent script can be generated by creating a Split method in the first place, I think this is a low priority.
At the moment, types such as Vector3 are also provided with a Split extension method included.
As for option 1, the issue is how to generate the splitting code, so I don't have any prospects for it at this time.
Thank you for your feedback.
I have already made a note of field splitting as an issue to consider.
Taking user-defined types into account will require the use of the script generation function, so I am considering option 2, but since an equivalent script can be generated by creating a Split method in the first place, I think this is a low priority.
At the moment, types such as Vector3 are also provided with a Split extension method included.
As for option 1, the issue is how to generate the splitting code, so I don't have any prospects for it at this time.
Thank you for your feedback.
-
- Posts: 17
- Joined: 2025/03/29 09:07
Re: [Feature Request] Having the possibility to split variables in a struct as individual output port
Thank you for the response!
I thought of code generation but I personally don't really like code generation (I prefer explicit control over the code).
Also then I will have to separate scripts into assemblies
(I am lazy when it comes to that)
I guess I will just have to sit down and finally organize my scripts into assemblies now
But I didn't know Extension functions could also work in this case as well (so I don't have to put the split method inside the struct itself).
Thanks for the tip!
I thought of code generation but I personally don't really like code generation (I prefer explicit control over the code).
Also then I will have to separate scripts into assemblies


I guess I will just have to sit down and finally organize my scripts into assemblies now

But I didn't know Extension functions could also work in this case as well (so I don't have to put the split method inside the struct itself).
Thanks for the tip!
- caitsithware
- 管理人
- Posts: 133
- Joined: 2024/03/26 01:56
Re: [Feature Request] Having the possibility to split variables in a struct as individual output port
There is another way to access fields, using reflection, but it is expensive, so I would like to avoid this as much as possible.
There is no access method that does not use code generation or reflection, so this would be impossible
There is no access method that does not use code generation or reflection, so this would be impossible
-
- Posts: 17
- Joined: 2025/03/29 09:07
Re: [Feature Request] Having the possibility to split variables in a struct as individual output port
Yeah, no problem!
At the moment I will just do what you did with Vector3, having a split extension function and generate node code for that function.
At the moment I will just do what you did with Vector3, having a split extension function and generate node code for that function.