Hi. I have set up a blueprint that I am trying to replicate in C++. I can do the trace fine, but I'm struggling to get Hit information from the array as shown in the blueprint. Without it I cant use FHitResult.GetActor() or anything.
here is the code I have so far
Thanks in advance
Are you getting a Crash or something? If so Please tell what it says.
Try this instead the foor loop:
Aside from that make sure GetWorld() is valid everything else looks fine to me.
answered Apr 11 '17 at 01:39 AM
ah I actually just fixed this but thanks for the reply!
Basically, I had my array of FHitresults called "HitResults" and a FHitResult variable called HitData.
I just needed to add the following line so Hitdata was fed the information from HitResults on every iteration of the loop.
HitData = HitResults[i];
Caused my game to crash before, but this fixed it. Cant see it being a problem if I extend to multiple enemy types either.
Unless I'm missing something? Just means I will have to cast to every enemy type and declare its ->Damage() function.
answered Apr 11 '17 at 02:35 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here