Getting location from a UActorComponent
So as the question says. I know it not really possible but I have an array of UActorComponents from using getCompoentByClass and I need to be able to get the location and set velocities of the components when I've done it in blueprint it's fine because the array returned is of type UStaticMeshComponent not UActorComponent. This is what I have currently and the issue it within the for loop when I'm trying to receive the location for the component.
is there any way to change the code i have to make it work or anything else?
asked Feb 16 '17 at 01:15 PM in C++ Programming
I've managed to figure this one out but ill post the solution anyway as it took me a while to get what I needed.
So once I had my array of UActorComponents I was trying to cast the whole Array over to UStaticMeshComponet but I was having difficulties. In the end, I passed the array into the for loop like before and then once dealing with individual components I was able to cast the component type over.
This is what I ended up with and it works perfectly for me.
answered Feb 16 '17 at 04:37 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here