I am trying to get every component that is in my blueprint into an array of components. The easy part is making an array and putting in each component individually. The problem is that every time I add something to my blueprint I have to manually add it to the array, I know that I can do it in C++ but I haven’t used it yet and don’t feel like using it for my simple project. Is there any “ForEach Scene Component” loop that finds every component? Picture related ofc.
You can use the GetComponentsByClass node which returns an array of references. Going by your screenshot, the Component Class is probably StaticMeshComponent.
GetComponentsByClass: SceneComponent, would probably get all of them, including the box component.
Is there anyway to get all components instead of all components of class?
Sorry to necro, but this answer is wrong. Get Component By Class returns the FIRST element. As this is the #1 google response for getting all components, I think readers will find it helpful to use Get Children Components of the root component. This returns an array.
Sorry to necro, but this answer is wrong. Get Component By Class returns the FIRST element. As this is the #1 google response for getting all components, I think readers will find it helpful to use Get Children Components of the root component. This returns an array.