6

Is there any method, such as coding or using a free asset to make screen recording function in my game.

I'm working on Unity and my project needs to provide a replay when I am playing my game and make the output of that replay as a file.

Thanks in advance.

derHugo
  • 83,094
  • 9
  • 75
  • 115
Bose Sanamchai
  • 105
  • 1
  • 1
  • 6

1 Answers1

8

You can check out our open-source project: https://github.com/getsocial-im/getsocial-capture. C# examples are in the readme.

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.

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

GetSocial GIF Capture library

Ostap Andrusiv
  • 4,827
  • 1
  • 35
  • 38
  • Warning to those using HDRP/LWRP, or any other SRP: This project doesn't work with the new render pipeline. The reason is because it relies on OnRenderImage being called, which doesn't occur in SRPs (at least not as of Unity 2019.1 / HDRP 5.16) – Dan Jul 03 '19 at 18:45
  • 1
    The project has been updated, now it supports SRPs. – BoygeniusDexter Aug 29 '19 at 12:18