Hello guys
I follow this tutorial on youtube how to make an autowalk feature for the google cardboard VR.
My problem is the script doesn’t work for unity 5.2.
In the video Daniel explains to put the FPS controller script on the “head” object.
But since unity 5 it would only work on the CardboardMain object.
I tried working my way around it by chaning the code to look at the CarboardMain instead of the head object, but I cant get it to work.
Any ideas on an easy autowalk function for the VR ?
Thanks
Apologies for writing a commment in the answer section. Here is the solution which I found to work.
I added the script by Juppotto to the CardboardMain object.
// This script moves your player automatically in the direction he is looking at. You can
// activate the autowalk function by pull the cardboard trigger, by define a threshold angle
// or combine both by selecting both of these options.
// The threshold is an value in degree between 0° and 90°. So for example the threshold is
// 30°, the player will move when he is looking 31° down to the bottom and he will not move
// when the player is looking 29° down to the bottom. This script can easally be configured
// in the Unity Inspector.Attach this Script to your CardboardMain-GameObject. If you
// haven't the Cardboard Unity SDK, download it from https://developers.google.com/cardboard/unity/download
using UnityEngine;
using System.Collections;
public class Autowalk : MonoBehaviour
{
private const int RIGHT_ANGLE = 90;
// This variable determinates if the player will move or not
private bool isWalking = false;
CardboardHead head = null;
This file has been truncated. show original
This works well with Unity 5.3 but I have not tried with 5.2.
I found the magnet unresponsive as a movement trigger. This could well be due to the phone I am using to test. I am using “Walk When Look Down” to start and stop walking. I find Threshold Angle of about 5 degrees works well.