How do I get the size of GetOverlappingActors?

Hi guys,

I’m doing a method that returns true/false depending if it’s some actor inside of the pressure plate, but I can’t get the size of the GetOverlappingActors array (I did it but in an ugly way)

Right now i’m counting with the for, but I think that’s so horrible :frowning:

I let you a screenshot of my code I think it should be more easy like overlappingactors.size(), length() or something like this (even I tried size(var), but it didn’t work)

Thanks

If you look at Unreal’s documentation for the TArray, it has a list of all the methods you can call on an array. The one you’re looking for is, for some reason, Num().

Thank you! Was so easy… I google it and got this https://stackoverflow.com/questions/4108313/how-do-i-find-the-length-of-an-array

That’d work perfectly fine for normal arrays, but this is an Unreal-specific TArray class, so you need to look at their documentation for it, or specify the actual class name when you search.

Privacy & Terms