Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by tunds · Oct 17, 2016 at 06:43 AM · vrbeginnergoogle

Moving the user with google cardboard SDK

I'm using the google cardboard SDK and i have a script attached to the child "Head" in the GvrMain prefab. There's also a Character controller connected and the vrCamera variable has been set to the "Head" object to this so that i can move the user based on the code which will follow.

Here is a link to what my scene looks like and what the head object looks like in unity and it's configuration.

https://drive.google.com/file/d/0B0QLbDLfJn6_dFBRTXpId09vaEU/view

The issue i'm having is that i want to move the character when the user tilts their head at an angle, all this works fine but the issue is that when the simpleMove function is called nothing is happening... I've logged to see if any of the variables upto the point are empty but none of them seem to be; just this function doesn't seem to be getting called. Code below.

 public class VRLookWalk : MonoBehaviour {
 
     public Transform vrCamera;
 
     public float toggleAngle = 30.0f;
 
     public float speed = 3.0f;
 
     public bool moveForward;
 
     private CharacterController myCC;
 
     // Use this for initialization
     void Start () {
 
         myCC = GetComponent<CharacterController> ();
 
 
     }
 
     // Update is called once per frame
     void Update () {
 
         if (vrCamera.eulerAngles.x >= toggleAngle && vrCamera.eulerAngles.x < 90.0f) 
         {
 
             moveForward = true;
 
         } else {
             moveForward = false;
         }
 
         if (moveForward)
         {
 
         Vector3 forward = vrCamera.TransformDirection (Vector3.forward);
             myCC.SimpleMove (forward * speed);
         }   
     }
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by OpenXcell-Studio · Oct 17, 2016 at 06:57 AM

folow the step:

1)delete all thing except terrain and direction light

2)drag GvrMainViewer.prefab

3)create new camera name it maincamera

4)add character controll and vr look walk on maincamera

5)than drag maincamera in to vr camera

play now

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tunds · Oct 17, 2016 at 07:02 AM 0
Share

Still no difference :( the simple$$anonymous$$ove function isn't firing for some reason

avatar image OpenXcell-Studio tunds · Oct 17, 2016 at 09:13 AM 0
Share

you have to drag just GvrVieqwer$$anonymous$$ain.prefab

not Gvr$$anonymous$$ain and not need of head in his child

and in vr camera assign maincamera after complete above step

and assign character controller on maincamera and vr look walk script is also on main camera and than in public vr camera drag the main camera

avatar image tunds OpenXcell-Studio · Oct 17, 2016 at 09:34 AM 0
Share

Here is a screenshot of the prefabs in the folder i just realised that i have to use the legacy folder "Gvr$$anonymous$$ain" since when i want to use the GvrViewer$$anonymous$$ain or GvrController$$anonymous$$ain it just seems to be an empty object like the first two links i just posted.

GvrController Gvr$$anonymous$$ain LegacyGvr$$anonymous$$ain

Show more comments
Show more comments
avatar image OpenXcell-Studio · Oct 17, 2016 at 10:12 AM 0
Share

accept the answer if it solved your problem, vr mode is on than only your main camera move with your head movement

avatar image
0

Answer by walidabazo · Sep 22, 2017 at 11:19 AM

Show this videos

https://youtu.be/9pf8CeN5SvA?list=PLazvcyckcBwjSxqwlSr6c2l8FEK-vxSV8

https://youtu.be/559WxKPYdRo?list=PLazvcyckcBwjSxqwlSr6c2l8FEK-vxSV8

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

94 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it possible to implement a double press/click magent button functionality for Google Cardboard? 0 Answers

Google Carboard Compiler Error On Load 3 Answers

How to make a proper Drag&Drop (any GameObject) for the Hololens (Unity3D) 0 Answers

GvrRectile not responding 1 Answer

Pickup Objects with Google Daydream Controller 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges