I changed the cast to cast from the UBlueprint pointer to the IUnit pointer and it didnt work but changing the line to a normal c++ cast worked:
i haven’t got the rest of the blueprints finished yet so i cant test this all out yet but if this way doesn’t work i will try that. Yeah i think they should really rename all the getclass functions because its extremely hard to remember which one does what