I am adding the following line of code in my script to enable controller support for unity VR game which is being played in google daydream. Without this code, the controller is not showing in the final build of the game
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class InputManager : MonoBehaviour
{
public GameObject controllerMain;
public GameObject controllerPointer;
private void Start()
{
controllerMain.SetActive(true);
controllerPointer.SetActive(true);
GvrPointerInputModule.Pointer =
controllerPointer.GetComponentInChildren<GvrLaserPointer>();//3
}
}
Can someone explain me why I need to enable controllermain and controller during gamelay they are not disabled in the hierarchy. And explain the 3rd line of code