A Unity Editor tool that adds a Screenshot tab to the Inspector preview for objects placed in a scene. Use it to frame an object and save a transparent PNG without setting up a separate screenshot camera.
I made this while developing Camp Paradise: Island Resort Tycoon.
- Make sure your project uses the Universal Render Pipeline (URP) - Untested with standard.
- Copy
PrefabPreviewScreenshot.csinto an Editor folder in your Unity project—for example,Assets/Editor/PrefabPreviewScreenshot.cs. - Let Unity finish compiling.
The Editor folder is required because the script uses Unity Editor APIs and must not be included in a game build.
- Select a GameObject placed in a scene that has a visible Renderer.
- Open its Inspector preview and select the Screenshot tab if not already selected.
- Adjust the view, choose a resolution, and click Save PNG.
- Left-drag: Rotate the object view
- Right-drag: Adjust the preview lighting
- Middle-drag: Pan
- Scroll wheel: Zoom
The toolbar also has zoom, silhouette, bloom and resolution options. If the object has animation clips, you can choose a clip and scrub to a pose.
Images are saved to Assets/Icons/PrefabIcons/ as transparent PNGs and imported as Sprites. Saving another image of an object with the same name will overwrite its previous screenshot.
- The object must be placed in a scene. Selecting a prefab directly in the Project window is not supported.
- The preview uses lighting from the open scene.
- This version is built for URP; other render pipelines have not been tested.
- Terrain objects are not supported.