Dive Board



autowalk solved

autowalk solved

by crow34 on Jan 5th, 2015 07:12 AM

I found a solution that allows developers to autowalk like the Tuscany dive demo

Place a sphere above or below the main camera and create a autowalk.cs with the following script

And you will need to apply a character controller and a fpscontroller

https://www.dropbox.com/s/2r8j7xp56pupv ... lk.cs?dl=0

using UnityEngine;<br />using System&#46;Collections;<br /><br />public class Autowalk &#58; MonoBehaviour {<br /><br />	private CardboardHead head;<br />	private Vector3 startingPosition;<br />	private float delay = 0&#46;0f; <br /><br />	void Start() {<br />		head = Camera&#46;main&#46;GetComponent&lt;StereoController&gt;()&#46;Head;<br />		startingPosition = transform&#46;localPosition;<br />	}<br />	<br />	void Update() {<br />		RaycastHit hit;<br />		bool isLookedAt = GetComponent&lt;Collider&gt;()&#46;Raycast(head&#46;Gaze, out hit, Mathf&#46;Infinity);<br />		// if looking at object for 2 seconds, enable/disable autowalk<br />		if (isLookedAt &amp;&amp; Time&#46;time&gt;delay) { <br />			GameObject FPSController = GameObject&#46;Find(&quot;Head&quot;);<br />			FPSInputController autowalk = FPSController&#46;GetComponent&lt;FPSInputController&gt;();<br />			autowalk&#46;checkAutoWalk = !autowalk&#46;checkAutoWalk;<br />			delay = Time&#46;time + 2&#46;0f;<br />		}<br />		// currently looking at object<br />		else if (isLookedAt) { <br />			GetComponent&lt;Renderer&gt;()&#46;material&#46;color = Color&#46;yellow; <br />		} <br />		// not looking at object<br />		else if (!isLookedAt) { <br />			GetComponent&lt;Renderer&gt;()&#46;material&#46;color = Color&#46;red; <br />			delay = Time&#46;time + 2&#46;0f; <br />		}<br />	}<br />	<br />}

crow34

Posts: 21

Joined: 29.01.2014

dive-owner


Re: autowalk solved

by Juju on Jan 6th, 2015 23:33 PM

Hey, thaks for the solution, this is exactly what I was looking for.
I'm a total beginner with Unity and I am writing an Cardboard App very similar to the Tuscany dive app. Could you please tell me how I create the fps controller and the charactercontroller and what I have to write into these scripts?

Thanks alot.

Juju

Posts: 1

Joined: 06.01.2015


Re: autowalk solved

by crow34 on Jan 7th, 2015 10:16 AM

It appears that bacongames has beat me to the finish line

Search the asset store for no click GUI this will provide you with a working autowalk feature

crow34

Posts: 21

Joined: 29.01.2014

dive-owner


Re: autowalk solved

by monome on Jan 15th, 2015 03:55 AM

Hey everyone for some reason I am getting a compiling error. Any ideas. Could someone possible post a pre built character for me to take a look at? Thanks for any input.

monome

Posts: 1

Joined: 15.01.2015


Re: autowalk solved

by Refref1990 on Aug 9th, 2015 20:16 PM

Hi! I have created a game with the autowalk, but i want who the circle with the script be under my feet, like tuscany dive. But when i put the circle under my feet, in the same folder of the cameras, this follow my head, so when i try to see, the cirlce go behind my head. Any solutions?

Refref1990

Posts: 5

Joined: 09.08.2015


Re: autowalk solved

by Glocksilverna on Oct 5th, 2015 06:31 AM

A point that I was interested in a joint comment.

Glocksilverna

Posts: 2

Joined: 05.10.2015


WW

by mtom78632 on Jul 18th, 2021 13:09 PM

Can I recently say that of a relief to discover someone that actually knows what theyre talking about over the internet. You actually discover how to bring a challenge to light to make it important. The diet have to look at this and fully grasp this side on the story. I cant think youre no more popular since you absolutely possess the gift. agen sbobet

mtom78632

Posts: 728

Joined: 23.08.2020


mtom

by mtom78632 on Jul 31st, 2021 07:44 AM

[color=#000000][size=2][font=Verdana, Geneva, sans-serif]I am often to blogging and i also really appreciate your content regularly. Your content has really peaks my interest. I am about to bookmark your site and maintain checking for first time data. [color=#0000aa]http://localizarnumero.com[/color][/font][/size][/color]
[color=#000000][size=2][font=Verdana, Geneva, sans-serif]---------------[/font][/size][/color]
[color=#000000][size=2][font=Verdana, Geneva, sans-serif]I used to be recommended this blog by means of my cousin. I’m not sure whether or not this publish is written by means of him as nobody else realize such distinct about my problem. You’re wonderful! Thanks! [color=#0000aa]420 for sale perth[/color][/font][/size][/color]

mtom78632

Posts: 728

Joined: 23.08.2020


Re: autowalk solved

by mtom78632 on Jul 31st, 2021 13:18 PM

I can’t really help but admire your blog, your blog is so adorable and nice .   Interior design

mtom78632

Posts: 728

Joined: 23.08.2020


Re: autowalk solved

by mtom78632 on Sep 23rd, 2021 15:38 PM

I like this blog  so much,  saved to my bookmarks . develeper practice Test

mtom78632

Posts: 728

Joined: 23.08.2020