Get All Actors Of Class Not Valid no matter what class is selected

Ran into something weird today…Get All Actors Of Class node does not find any actors (child or parent) from any class no matter what class is selected or how it is piped in. I have tried about 6 different actor classes and all come up empty. I am upgrading to 4.20 from 4.19 and building source files now so hopefully that will knock some sense into it. But wanted to ask here in the mean time…does this sound like an engine problem or is there some limitation that Get All Actors Of Class node has that I am not aware of?

Thanks

I’ve had some issues with it and connecting a forEachLoop.
When I change the actorClass I have to remove the forEachLoop and the GetAllActorsOfClass and new ones. But I guess you’ve tried that already

Yeah I’ve seen that issue too, no this is like the Get Actor Class node isn’t working at all. It doesn’t get any actor no matter the class or how I retrieve the data from the array output.

Sounds weird, got any screenshots?

Yeah if it still isn’t working after upgrade and source build I will post some

Yeah I am stumped I must be missing something fundamental about how this node works. I’ve used this node many times so I am a pretty confused. Attached is an image…

  1. Image of get all testing whether it is valid and if anything prints after the appended “Actor class name”. I get Not Valid and is there is no display name to print.

  2. I plug a different array of classes into the it and still get Not Valid and no display name on print

3.Although I get not valid and no display name, the get node does allow me to choose the actors variables without error. When used in game though I get accessed none.

For each loops also come up blank. I have tried 5 other actor classes that I often use and none output any actor from this node. Am I missing something or what???

Ok I just figured it out, so Get All Actors of Class only works for actors that are spawned in the world. Been using Unreal for 3 years and just now realizing that.

1 Like

Ahh :slight_smile: Good to see you solved it

On the GetClass() function within the FAssetData struct there this comment left by EpicGames:



**/** Returns the class UClass if it is *loaded*. It is not possible to load the class if it is unloaded since we only have the short name. */**
    UClass* GetClass(...){}


What you can do from the ***OutAssetData ***is check if IsAssetLoaded() then get the ***ToSoftObjectPath() ***function and with that, call ToSoftObjectPath()->TryLoad();
TryLoad() will return the result UObject pointer, so that way you can force your Blueprint Object to be loaded before you call GetClass() function.