How to record game interface in Unity Editor

The ways to record screens in Unity Editor mainly include Unity’s built-in screen recording and the official screen recording plug-in Unity Recorder , which are limited to the Windows platform. Their common functions are:

  • Customize the resolution of the output video, not limited by the resolution of the screen
  • Support to output various types of output, such as video, animation clip, sequence frame, GIF, panoramic video, etc.
  • Better video image compression

Compared with Unity's own screen recording, the plug-in Unity Recorder has the following advantages:

  • Not limited to Windows platform
  • Able to record multiple cameras at the same time, that is, the output of multiple Camera lenses
  • Can be used with Timeline

Of course, these two methods are only used in the editor , and cannot be used in projects such as building OS, Android, and WebGL.

The following describes the use of these two methods respectively.

Comes with screen recording

Unity Editor has its own screen recording function, which can only be used on the Windows platform, otherwise the recording option does not appear in the menu bar.

First, as shown in the figure below, click Window on the menu bar, and then click General > Recorder > RecorderWindows.

built-in-recorder-window

After selection, the Recorder window will pop up, and then click Add New Recorders to select the recorded content, such as animation clips, videos, picture sequences, GIFs, etc.

built-in-recorder-export-types

In the video recording window, you can set the frame rate, format, resolution, video output path, etc. yourself. After setting, click the red button to automatically run the project and record the Game interface.

built-in-recorder-export-setting

Unity Recorder plugin

The Unity Recorder plug-in has more functions. The following describes the installation and use of the plug-in.

plugin import

Click Package Manager in Window on the menu bar , open the package manager, and switch to Packages:Unity Registry , as shown in the figure below.

pkg-manager

In the search box in the upper right corner of the manager, enter Unity Recorder to find the plug-in, and click Install .

Record screen with TimeLine

First, create the TimeLine object in the resource:

create-timeline

Then, click the plus button on the left side of TimeLine, click Add Recorder Track, and add Recorder Clip on the right side after creation:

create-track

create-clip

Double-click the Clip and configure it in the Inspector panel:

edit-clip

The detailed configuration is as follows:

  • Selected recorder: Select the recording type, such as video Movie, etc.
  • Capture: Set the recording screen object, such as the Game interface or the capture interface of a camera
  • Format: Select the output video format
  • Output File: Set the video save path

After configuration, create a Playable Director component on an object in the Scene, and drag the newly created TimeLime object to the Playable location.

recorder-plugin-set-object

Check Play On Awake here to start recording automatically when the game is running. When the TimeLine time pointer completes the Recorder Clip segment, it will be automatically saved to the previously configured folder.

If not checked, you need to control its startup in the code. The Playable Director component is UnityEngine.Playablesin . When writing code to control this option, you need to reference the namespace first, and then the code obtains the Playable Director component object mounted in the Scene, and uses Play()the and Stop()functions for manipulation.


So far, the two screen recording methods in the Unity Editor have been introduced.

I originally wanted to introduce NatCorder , a screen recording plug-in that can be used on iOS and other platforms, but it has been removed from the shelves now, and the new cross-platform screen recording plug-in needs money, so I didn’t introduce it.

Guess you like

Origin blog.csdn.net/weixin_45497461/article/details/125849826