Saving Prefab

I was wondering how to save a game object as a prefab to a local folder using a script.

My script generates some random game objects and I would like to use the script to save them to a folder. How do I do this? I have been through the manual and cannot figure it out

Have you looked at the PrefabUtility.CreatePrefab method? I’m pretty sure that’s what you want.

Yes that’s it thank you. I don’t know how I managed to skip over that one