Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen record in unity3d

How to do screen record in unity? I want to record my screen(gameplay) during my running game. That should be play/stop , replay , save that recording on locally from device, open/load from my device (which is already we recorded).

In my game one camera which can capture native camera, and one 3d model.

I wish to record that both and use my functionality whenever i want.

Thank you in advance.

like image 338
Sudhir Kotila Avatar asked Feb 02 '15 12:02

Sudhir Kotila


People also ask

Does Unity recorder work in build?

You can only use the Recorder in the Unity Editor. It does not work in standalone Unity Players or builds. To capture Play-mode data you need to set up Recorders. Each Recorder controls a single recording, and specifies details such as the data source, resolution, and output format.

How do I record my timeline in Unity?

In the Timeline window, click the Add (+) button. From the context menu, select UnityEditor. Recorder. Timeline > Recorder Track.

Can you record animation in Unity?

The Animation Recorder allows you to record any changes you make to a gameObject and its children during game play.

Can you record audio in Unity?

Audio RecordingUnity can access the computer's microphones from a script and create Audio Clips by direct recording. The Microphone class provides a straightforward API to find available microphones, query their capabilities and start and end a recording session.


2 Answers

This is hard to implement, but not impossible. Because every frame or interval you need to capture screen shot of your camera view and store it in the list. You need good, (Smaller interval but not much. Because when it becomes smaller, needs more memory) interval value. If your interval is big raplay can be seen laggy.

While you play game your ram becomes full and os will terminate the app. So you need to fully cover memory optimization. Another solution is assets in Unity Asset store.

EZ Replay Manager can be used. (Keep in mind: I haven't tried it yet.)

Free

Pro

like image 120
Barış Çırıka Avatar answered Sep 29 '22 23:09

Barış Çırıka


Check out this open-source project: https://github.com/getsocial-im/getsocial-capture. By default our project records Main Camera's rendered content. C# examples are in the repo.

You can record in 2 modes:

  1. Continuous mode - capture last X frames.
  2. Manual mode - capture frames on your own when needed. For example, record a timelapse of the level.

Once the recording is done, you can generate GIF, get raw bytes and do whatever you want. E.g. let your users share that GIF with friends.

Here's the recording of a game session from the test app. The recorded GIF shows up in the end:

GetSocial GIF Capture library, preview via GetSocialCapturePreview

Disclaimer: I worked at GetSocial at the time of writing.

like image 37
Ostap Andrusiv Avatar answered Sep 29 '22 22:09

Ostap Andrusiv