I will describe a method of mine of how to play 360° video in Unity 3D. The idea is, set a camera in the center of a sphere and put the video on the sphere surface. Here are the steps:

Prerequisites

  • 360° Video. You can download it here free, and is suffice for this test.
  • QuickTime for importing the video to asset.

Create Sphere

First, we need to make a sphere object with faces facing toward the center (inside) of sphere. For this, I make it with Blender which is for me it’s the best and free 3D modelling software.

If you think “Why don’t we just make sphere object directly in Unity?” – Yes that’s true, but the UV mapping doesn’t suit with video texture due to jagged texture displayed on top and bottom of the sphere.

You can follow this tutorial to create the sphere and map its UV.

https://www.youtube.com/watch?v=yc0b5GcYl3U

After you made it, next step are flip all the faces toward inside and horizontal flip the UV map.

Faces flip

We need to flip all the faces so they will be facing toward inside. While still have the sphere in selection, go to Edit Mode and select all the faces.

image-01

Select all faces in Edit Mode by pressing “A” key

UV flip

While all faces are still in selection, switch Editor Type to UV/Image

image-02

Switch to UV/Image Editor

image-03

Horizontal Flip the UV

Conveniently, save the blender file directly inside assets folder and let Unity handle the import process.

Scene setup

Put the sphere onto scene and set the position to: 0, 0, 0; and optionally scale its size to your need.

Move the camera position to: 0, 0, 0. Because we want the camera to be inside the sphere.

Then import a 360° video by drag-n-drop it to unity hierarchy panel or by put the video file into project assets folder. It will take some time to import (depends on file size), so be patient.

Select the sphere on scene and apply video texture to sphere material.

Select the sphere, and drag-n-drop the video to sphere material

Create VideoPlayer.cs script to autoplay the video, and apply the script on sphere object.

Set the Global Ambient Light to White color. Open at menu Window > Lighting, and select the Scene tab.

Change the Amibent Color to White (#FFFFFF)

Set the Amibent Color to White (#FFFFFFFF)

Play the Unity, and you’ll see the sphere is playing the video. And when you orbiting the camera, you can see the whole 360° video.

Now, in the game view, we want to make the camera look around accordingly to mouse movement, hence we create this new script: MouseLook.cs. The script is taken from this thread and the credit goes to the original maker.

Then, apply the script to Main Camera.

When you play it again, you can look around in the game view.