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

**URL:** <https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [August 19, 2018, 2:51pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214 "2018-08-19T14:51:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allenheathx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Allenheathx](https://forums.unrealengine.com/u/Allenheathx)\
**Post date:** [August 19, 2018, 2:51pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/1 "2018-08-19T14:51:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3d784e28](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3d784e28](https://forums.unrealengine.com/u/anonymous_user_3d784e28)\
**Post date:** [August 19, 2018, 4:25pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/2 "2018-08-19T16:25:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Allenheathx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Allenheathx](https://forums.unrealengine.com/u/Allenheathx)\
**Post date:** [August 19, 2018, 4:55pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/3 "2018-08-19T16:55:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3d784e28](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3d784e28](https://forums.unrealengine.com/u/anonymous_user_3d784e28)\
**Post date:** [August 19, 2018, 5:14pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/4 "2018-08-19T17:14:13Z")

</div>

Sounds weird, got any screenshots?

---

<div class="post-metadata">

**Author:** ![Allenheathx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Allenheathx](https://forums.unrealengine.com/u/Allenheathx)\
**Post date:** [August 19, 2018, 6:38pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/5 "2018-08-19T18:38:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Allenheathx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Allenheathx](https://forums.unrealengine.com/u/Allenheathx)\
**Post date:** [August 19, 2018, 10:29pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/6 "2018-08-19T22:29:44Z")

</div>

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???

---

<div class="post-metadata">

**Author:** ![Allenheathx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Allenheathx](https://forums.unrealengine.com/u/Allenheathx)\
**Post date:** [August 20, 2018, 3:46pm UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/7 "2018-08-20T15:46:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3d784e28](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3d784e28](https://forums.unrealengine.com/u/anonymous_user_3d784e28)\
**Post date:** [August 21, 2018, 4:55am UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/8 "2018-08-21T04:55:16Z")

</div>

> [@Allenheathx](#):
>
> 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 🙂 Good to see you solved it

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [August 22, 2018, 7:21am UTC](https://forums.unrealengine.com/t/get-all-actors-of-class-not-valid-no-matter-what-class-is-selected/115214/10 "2018-08-22T07:21:25Z")

</div>

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

```auto

**/** 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.
