How to convert gameobject into prefab at runtime?

I am trying to convert a gameobject into a prefab to a specific folder using code. Basically, when the user hits the done button, a gameobject should be converted into a prefab to a specific folder from where those prefabs will be sent to firebase storage. I didn’t find any way to do it. Is it even possible?

It is indeed, impossible, BUT there is a pretty simple workaround. Say you want to create a prefab at runtime of skyscraper B. Save a prefab of Skyscraper A, then put one in your scene, and set it to inactive. Then, edit that object at runtime, and just instantiate whenever, so it acts like a prefab.

The best way to do this is to set up a custom save system that uses .bin, .json, or .txt files. You’ll need to have a script that can create a .bin, .json, or .txt file on disk, and then have the GameObjects re-construct themselves upon instantiation (via Start(), Awake(), etc) using the custom file. There’s no way to save a prefab directly in a built game, but using .bin/.json/.txt allows you to achieve the same effect for almost any aspect of any game.