It seems any blueprint I have created with my custom C++ classes can not be selected in the defaults of another blueprint. If I put a blueprint reference into the game then select it in the drop down I get this error. “illegal TEXT reference to a private object in external package”.
I am making an inventory system with pick up items and weapons. so when you pick up the item or weapon that class has a variable to point to a weapon blueprint, which then gets added to the inventory. However I can not seem to link any of my custom c++ classes to each other. Is there something I am missing here? The weapon.h and pickup.h files extend AActor and I have include the [PROJECTGAME]_API macro as i thought this might be it, but no go. What am I missing? on version 4.7 right now.
Ideally I do not want to have to put a reference into the game , I want to spawn them at run time using the selected weapon blueprint class. Also looked through the shooterGame c++ code and cant see any differences yet.
okay so I dont know if this is the best way as I would like to just select a blueprint. But instead I added a UClass* WeaponClass and am going to spawn that and assign it to the Weapon variable. Is there any way to select the blueprint itself? using this: AWeapon* Weapon seemed to almost work…
If I understand it correctly this should serve your purpose. Spawn your object using this instead of a UClass* and you should be able to alter/use it anywhere, both in code and in blueprint.
How did you solve the issue? I have the same problem. Are you using it as a Uclass and casting it back? or are you creating a new object in the scene with the references set to this and use it for initialization?