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 azinicus · Aug 30, 2016 at 09:45 PM · vrangles

Steam VR 1 out of 4 angles not registering correctly

We are making a VR block puzzler game in Unity 5.4 (VR Mode enabled/single pass stereo rendering on) using SteamVR + VRTK and HTC Vive HMD & controllers. In this game we rotate gameobjects based on the camera position and respective object position so we get a logical rotation form perspective of the player. Everything is working great except one view angle, the script is not receiving the right info about the positions or maybe calculations are not right. It is very strange because all view angles are working perfectly except that one (the angle from the left of the starting position if you’re looking at the center of your roomscale play area), from that specific angle, it works very sporadically, almost as if the coordinates are not registering. Note: our swiping mechanic works fine from that angle, it just seems to be the rotate left, right, forward and back actions that don’t register correctly.

Screenshot example: https://dl.dropboxusercontent.com/u/7673/RLTYCHK/Bad%20angle.PNG

Here's the code we're using:

 if(controller && controller.touchpadTouched)
 {
     Vector3 difference = transform.position - cam.transform.position;
     float z = difference.z;
     float x = difference.x;
     if(!isTouching)
     {
         initialX = controller.GetTouchpadAxis().x;
 
 
         isTouching = true;
 
     }
     else
     {
         xOff = controller.GetTouchpadAxis().x - initialX;
         if(xOff > 0.3f && !swiped) //swipe right
         {
             Debug.Log("Swipe Right");
             if (Mathf.Abs (z) > Mathf.Abs (x)) {
                 if (z >= 0) {
                     transform.RotateAround (transform.position, Vector3.forward, -90);
                 } 
                 else {
                     //PROBLEMATIC ANGLE
                     transform.RotateAround (transform.position, Vector3.forward, 90);
                 }
             }
             else if (Mathf.Abs (z) < Mathf.Abs (x) ) {
                 if (x >= 0) {
                     transform.RotateAround (transform.position, Vector3.right, -90);
                 } 
                 else {
                     transform.RotateAround (transform.position, Vector3.right, 90);
                 }
             }
             SoundManager.main.PlaySound ("RotateBottom", GetComponent<AudioSource> ());
             swiped = true;
         }
         else if(xOff < -0.3f && !swiped)
         {
             Debug.Log("Swipe Left");
             if (Mathf.Abs (z) > Mathf.Abs (x)) {
                 if (z >= 0) {
                     transform.RotateAround (transform.position, Vector3.forward, 90);
                 } 
                 else {
                     transform.RotateAround (transform.position, Vector3.forward, -90);
                 }
             }
             else if (Mathf.Abs (z) < Mathf.Abs (x) ) {
                 if (x >= 0) {
                     transform.RotateAround (transform.position, Vector3.right, 90);
                 } 
                 else {
                     transform.RotateAround (transform.position, Vector3.right, -90);
                 }
             }
             SoundManager.main.PlaySound ("RotateUp", GetComponent<AudioSource> ());
             swiped = true;
         }
     }
 }
 else
 {
     
     xOff = 0;
     isTouching = false;
     swiped = false;
 }
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

0 Replies

· Add your reply
  • Sort: 

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

79 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

Related Questions

Trying to switch between 4 different cameras using mixed reality touchpad,Switching Between Four Different Cameras Using Mixed Reality TouchPad 0 Answers

Steam VR longbow Arrow wont fire 0 Answers

Fix rotation skipping 0 Answers

VR feed in a screen UI element performantly 0 Answers

drag/rotate objects with steam vr ,Dragging/Rotating an object with VR 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