Is it possible to cast Actor to Bueprint Actor in C++ and return it to Blueprint?
For example I have C++ class AMyGameMode, which is inherited from AGameMode, and MyGameModeBlueprint which is inherited from AMyGameMode. The project is setup as having MyGameModeBlueprint as Engines GameMode class.
Can I write UFUNCTION which will return World->GetGameMode() object, which will be interpreted as MyGameModeBlueprint type object in blueprints, without any subsequent casts in blueprints, and without using blueprint macros.
asked Sep 21 '15 at 08:11 AM in C++ Programming
No, because blueprints don't exist physicly as C++ code, so it does not exist during compilation code in order to link it sonehow. You would need to make custom UK2Node class for that, which would auto cast the output pin (Same as curently Spawn Actor node doing, which is also custom K2Node).
You may heard about this, theres currently experiments in Epic, to make blueprint compile to C++ code, this may allow easier access to blueprint classes in C++, which could let create such a node, with standard function bind.
Follow this question
Once you sign in you will be able to subscribe for any updates here