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:
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.
It refers to the CDO (class default object) for the unit and reads the costs from there without needing an actual unit spawned.