Runtime error

Hello,

I am getting an error in the branch node. The returned value of the is overlapping actor node is empty, but the blueprint is working well regardless to the runtime error.
Is there a problem if I did not solve this error? if yes how can I solve it?

Thank you,

The reference from Get All Actors Of Class node is probably not valid and that is why you are getting the error, you can check if it is valid with Is Valid node.

Let’s say you have 10 Sedans, by using Length and iterating through an array like this you are trying to access the 11th element that does not exist.

Try one of these instead:

887eadc16ac3bd7d8564ceaa0ffdeb2af1ca6b93.png

I’m still getting the same error.

for the sedan class actually I have a generator that generates cars from the beginning of the landscape and then when these cars arrives at the end of the landscape I destroy them. Do you think the generator can be the problem as the array size is changing!

Difficult to say what is causing this without seeing the rest of the code, especially if you run this on Tick and keep changing the size of the array. Have a look at what [MENTION=29846]Blue man[/MENTION] suggested above - drag a wire off Get and do IsValid - this will allow you to skip invalid references.

e30614b2164ff0af549dc0c5ecedbb5bdb5da006.jpeg

I tried to do IsVlalid and it always return invalid. So I have decided to not check the type of the car. Is there a way to check if there is an overlap with any movable or AI actor ?

Instead of doing Get all Actors of class and doing Is Overlapping, do

Get All Overlapping Actors

And cast them to the sedan

If there’s a successful cast, set IsOverlapping to true.

30df45ca9b562e284dd7a3b027d29b8c9d8815d2.jpeg

I did what you suggested, but I am still getting the same error the overlapping actors are empty sometimes so I am getting the error from the for loop.

I think the main problem is having a generator for the cars.

Any suggestions?