Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by CHADALAK1 · Feb 18, 2014 at 06:57 AM · camerarotationbonetransform.rotationtransform.rotate

Have Head Bone Rotate with Camera

Posted: 04:33 AM 1 Hour Ago I'm having a huge issue with the head bone not rotating with the camera. when i do this

 public Transform cameraObject; //I'm using a transform because I'm using the Oculus Rift for it's rotation
 
 public Transform headBone;
 
  
 
 void Update()
 
 {
 
      headBone.rotation = cameraObject.rotation;
 
 }

what happens is the head bone freaks out and seems like the bone is rotating infinitely. any idea how to fix this???

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
2
Best Answer

Answer by DerWoDaSo · Feb 18, 2014 at 12:44 PM

I guess you want to control the head bone with the occulus rift rotation, right?

A problem might be local and world rotation. If you set Transform.rotation it applies a the rotation without respect to it's parents rotation. If you read Transform.rotation you will get the world rotation, which is affected by the transform hierachy.

The opposite would be setting/getting the Transform.localRotation, which actually represents the rotation values you can see on the Transform component in the Inspector, which are relative to it's parent transform.

Comment
Add comment · Show 5 · 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 CHADALAK1 · Feb 18, 2014 at 05:57 PM 0
Share

the problem is if i even do this,

 headBone.rotation = cameraObject.localRotation;

it doesn't rotate with the camera every frame. It does it as if it was from the Start function... I even have the code in the Update function :(

avatar image CHADALAK1 · Feb 18, 2014 at 06:13 PM 0
Share

The problem with that is if i do this

 headBone.rotation = cameraObject.localRotation;

it wont update the rotation every frame. just right from the start. and it is in the Update function :(...

avatar image DerWoDaSo · Feb 18, 2014 at 06:14 PM 0
Share

$$anonymous$$ight be a silly question, but can you verify the transform you specify as cameraObject is actually rotating?

avatar image CHADALAK1 · Feb 18, 2014 at 08:09 PM 0
Share

actually, the silly question was right :P ... so I decided to switch to one of the OVR cameras... but i noticed it freaks out either way with the localRotation. maybe i should ask the forums on Oculus?

avatar image CHADALAK1 · Feb 19, 2014 at 05:58 AM 0
Share
     void LateUpdate()
     {
         neckRotation.rotation = camRotation.rotation * Quaternion.Euler(-180,0,90);
     }


I FIXED IT!! THAN$$anonymous$$S TO THIS LIN$$anonymous$$ from oculus unity4 support

Oculus Link

avatar image
0

Answer by H_Alhusban · Feb 18, 2014 at 12:13 PM

try just making the camera a child for the head bone then apply the camera-look script to the camera .

Comment
Add comment · Show 1 · 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 CHADALAK1 · Feb 18, 2014 at 06:00 PM 0
Share

I'm using an oculus rift

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

20 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

Related Questions

transform.Rotate For an Certain Amount of Time 1 Answer

How to rotate bone relative to camera using LookAt 3 Answers

2D camera rotating relatively to game object speed 0 Answers

Rotating game Object. 2 Answers

How to make a bone rotate facing towards a given Transform? 0 Answers


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