Turntable is a simple Unity Editor project for outputting videos and image sequences of assets rendered in real-time. It leverages the Unity Recorder to configure and output a wide range of file formats and resolutions.
TurntableAdjustingValues.mp4
Adjusting values before rendering turntable
movie_002.mp4
Example turntable video rendered with this project
The project works by rotating an object in a full circle, once the object has fully rotated the editor exits playmode. It uses ExecuteInEditMode attribute to update the camera position before rendering.
- Import objects into Unity and open the CaptureScene
- Drag object under the ObjectRoot game object and zero it out (position (0,0,0), rotation (0,0,0)) then adjust the height (y position) of the object to be roughly centered at ObjectRoot
- Locate the Turntable game object Turntable Controller component. Adjust values for
Camera Height Y
,Camera Distance From Object
,Camera FOV
(field of view),Camera Rotation
andObject Rotation
values to determine the starting camera setup for the render. - Locate the CaptureController component on the Turntable game object. Adjust the speed modifcations based on how fast you want the object to rotate.
- Setup the Recorder window.
The character root and ObjectRoot transforms. The Object root transform should be roughly at the center of the object.
The character prefab is offset -0.9 in the Y (height)
Editable values on the Turntable Controller and Capture Controller script
A default setup with the camera looking at the ObjectRoot that is a parent object of the offset character model
- Open the Recorder Window (Window -> General -> Recorder -> Recorder Window)
- Add Recorder select either movie or image sequence.
- Set Output Resolution to desired output quality.
- Hit the START RECORDING button. The project will enter play mode and leave playmode after a full rotation of the object.
Source: Leave at the default setting of Game View
Include Audio: Uncheck unless you have added audio to Unity and the scene
Example recorder setup to render a turntable video at 1080p
The project can be imported into an existing unity project or assets can be added to the Turntable project.
Download the latest release and import the .unitypackage into an existing Unity project. Open the CaptureScene and configure lighting settings and object.
You may need to import the recorder package into your project by going to Package Manager -> Unity Registry -> Recorder -> Install.
You can also drag the CaptureScene into an existing scene and transfer the game objects over using additive scenes.
Import any objects you want to render into the project and follow the steps under Scene Setup.
For built-in or HDRP you will need to adjust the Project Settings -> Graphics Settings.
The project is using the latest LTS (2021.3) but the scripts are compatible with any version of Unity.
The project is using Universal Render Pipeline (URP) but is compatible with any render pipeline.
When rendering an image sequence there may be some dropped frames at the end of the render while the recorder is manually stopped. To compensate for this you can wait additional frames before stopping my increasing the value of Number Of Frames To Wait
on the CaptureController component.