UnityでVRゲーム作成 その8

ディスプレイとOculus側で別の視点を映す方法

cameraを二つ用意する

カメラマンがいてそれぞれが別のステージを撮影している、みたいなイメージ

 

Oculus側のCamera

CenterEyeAnchorのInspectorにあるCamera

TargetdisplayはDisplay1 Target EyeはBoth 

 

ディスプレイのCamera

新規でcreate> cameraでつくる

Audio Listenerのチェックを外す(シーン内のマイク。これは1つのシーンに1つしか持つことができない)

TargetDisplayはDisplay1、Target EyeをNoneにする

つぎにVRmirrorSettingsというスクリプトを生成する

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VRmirrorSettings : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
UnityEngine.XR.XRSettings.showDeviceView = false;
}

// Update is called once per frame
void Update()
{

}
}

 

 これでOculus側でディスプレイが表示されないみたい

これをアタッチして実行するとうまくいくはず

f:id:Irena:20190925234902p:plain

 

参考 引用文献