Access None Trying to Read Property Actor Error

I have a function imported using the “add” method. It returns the error listed above. The same error occurs at two different nodes, though one node has the error consistently while the other less so; I am not sure why.

The GetAllActorsAOfClass fails to find any actors so it will return nothing. You will want to check that the array returned by that node has anything in it before attempting to get an index of said array.

If you want to find the closest actor of any type you can try this custom node it will simplify things for you significantly. All you need to do is input an array of actors however you want to obtain them (get all actors will work) but as the above comment states, you can’t pull an index of an empty array.

Also video #27 in the link below covers other typical causes of the accessed none error.