Download

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.

Ahh :slight_smile: Good to see you solved it

@Allenheathx

What was the ultimate goal here dude, get a list of Classes to pass to ‘Spawn Actor of Class’ or similar?
If so, maybe you can try and experiment with this… Note, unfortunately I haven’t figured it out yet either.:frowning:
OBJECT Class Reference won’t cast to ACTOR Class reference. Is there another way to approach this?

[spoiler]



BP:
Get Asset Registry -> Get All Assets -> Get Class -> Get Full Name
Works... Returns correct Pawn Class name

Get Asset Registry -> Get All Assets -> Get Class -> Get Display Name
Doesn't work... Returns 'Blueprint' for all classes found.

Get Asset Registry -> Get All Assets -> Get Class -> Cast To Actor Class
<Cast Failed>

Get Asset Registry -> Get All Assets -> Get Class -> Cast To Pawn Class
<Cast Failed>

Get Asset Registry -> Get All Assets -> Get Class -> Cast To <Insert Name Here specific Pawn Actor Class>
<Cast Failed>


[/spoiler]

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.