Bug with "is valid" node

Hello I have a weird “problem”
For some reason when AI tries to spawn unit its invalid (in blueprint it goes through the “IsValid” node where it fails) but when I go, as in picture, from “is Not Valid” to the rest of the code, the units gets spawned but it gives me errors:


errors:

Is There a fix for it? I mean it works so dont change that but its annoying to ha ve to close the pop up window with bug every time :slight_smile:

its probably your delay node, delay nodes and for loops don’t work together.

but there are a lot of points for error in that code, what specifically are you trying to do?

I think this node is the problem:


I’m not 100% sure but I’m guessing here you are trying to get the cost of the the unit to spawn. However, “Get Actor of Class” returns the first actual unit of that class and will return a non-valid actor the first time around (before there are any units of that type yet.)

Try using this node and let me know if it works.
image

It refers to the CDO (class default object) for the unit and reads the costs from there without needing an actual unit spawned.

oh wow I didnt even know that thing existed! thank you very much it instantly fixed exerything :smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.