Hi, I newbie in c++ and i need some help
I created c++ actor and I want to use this actor in other project but this project is blueprint type.
I suspect that there need to use plugin, but if I create plugin, will put my c++ actor there and just move this plugin folder into my other blueprint project i won’t see my actor
Actually, it’s not necessary to create a plugin for that. Just create a C++ file and set it as Blueprintable, BlueprintType on the specifiers of the UCLASS(). Also there is another post with the same question that can help you further here
The project changes to c++ project if you click File->New C++ Class…
You can then just delete the newly created files, and copy in your old files
A plugin should also work, but plugin-content are probably hidden in the content-browser.
Clicking ViewOptions->ShowPluginContent in the content-browser might help
Seems like the link wasn’t posted, so not sure how it looks there.
But it then should work in a plugin as i wrote.
Creating a child-blueprint of it can also be an easy way to get it to show up in the content-browser.
Compile it and now you can create new blueprint classes that inherit from AMyActor (or the actor you created on c++), you can also assign variables in BP as that class, for instance another class that has a variable of type AMyActor can now be used.
This doesn’t convert your project from Blueprint to c++, it just creates a class created on c++ that can be used alongside blueprint classes. Notice that blueprints are assets while cpp files are source, this means that blueprints can use c++ classes without any problems, but the same CAN NOT be said otherwise, using/referencing a bp from a cpp file is something I’m not sure is possible, and if it is, it will be a source of many headaches.
Not right away, you would need to make sure the dependencies are okay (the #includes) and compile it again in the new project. It should work after that.
Actually Blueprintable is inherited by subclasses, and AActor is Blueprintable, so this isn’t be necessary. The same may also go for BlueprintType, I have never put either specifier on my actor subclasses and haven’t run into any problems as yet accessing properties or functions.