Can you move files from project to a plugin?

So most of my plugin is already made and well. It compiles and functions as it should. except, I wrote all the code and all the blueprint logic as part of the project, and only at the end did i create the plugin.

Is it possible to move all of the content from the project to the plugin folder?

What I do (my plugin is not needed at runtime) is have them in the plugin content folder (copied there after creating them like you, in the project content) then copy them into the project folder when they are needed in code from the plugin - the BPs etc I have always go to the same named folder in all projects so anything like Material Instances etc that reference other assets from your Blueprints are correctly pathed. Make them all in the folder they will be copied to and paths should be ok.

Yes, it’s as simple and copy and pasting (while in the editor, you can find your plugins content folder there by exposing ShowPluginContent)

Just make nothing in the plugin folder is dependent on anything in the project folder. Other way around is fine though.

Hi! I moved the assets succesfully but I’m having a hard time copying the code over.

I tried copy pasting it from my source folder into the plugin/source folder, but when i add it into a different project it doesn’t work. any ideas?

Exactly what doesn’t work?

Hello. sorry for my late reply; I added the right dependencies and it works fine on the project. I moved the source files into the plugin files and when i try to package the plugin i get the error message:

UATHelper: Package Plugin Task (Windows): ERROR: Platform Android is not a valid platform to build. Check that the SDK is installed properly.

however, I am not trying to build the project for android. just for windows.

In your .uplugin try whitelisting the platform you want it to run for.

	{
			"Name": "ModuleName",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"WhiteListPlatforms": [
				"Win64",
				"Mac"
			]
		},

obviously change modulename to the module name

1 Like

oh wow. thank you very much!

Migrate the Project uassets to the plugin’s Content folder and delete them from the Project afterwards ? No ?