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 Doneyes · Aug 27, 2012 at 11:57 PM · rotationbonesrigarmaturebody

How can I make a certain bone rotate with the camera?

I am making a first person game that uses the full body and I want to rotate it realistically, so how do I rotate the Spine with the camera? Actually, scratch that. How can I rotate 4 bones with each bone moving 1/4 the speed of the camera? That way it looks a little more realistic with the full body turning. Thank you!

Comment
Add comment · Show 1
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 jorjdboss · Aug 28, 2012 at 05:41 AM 0
Share

I would do that in LateUpdate. Transform changes made here will be updated after the animation has played(for each frame). You'll have to experiment wil how much each bone rotates relative to the camera. Would be helpful if you put up some code showing what you're currently doing.

This link is useful when dealing with animations: http://docs.unity3d.com/Documentation/ScriptReference/AnimationState.html

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by vinod.kapoor · Aug 28, 2012 at 10:25 AM

 var vecttoq : Quaternion;
  var parent : Transform; 
 function Start(){ var parentRotInv : Quaternion= Quaternion.Inverse(parent.rotation); 
 vecttoq = parentRotInv*transform.rotation; 
 } 
 function Update(){ 
 transform.rotation=Camera.main.transform.rotation*vecttoq;
  }


assign the parent as the main/parent object at parent. attach this script to the spine or whichever part you wish to rotate with camera

Comment
Add comment · Show 3 · 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 Doneyes · Aug 28, 2012 at 03:10 PM 0
Share

Okay so how do I rotate two bones half the speed of the camera? It looks more realistic.

avatar image Doneyes · Aug 29, 2012 at 12:03 AM 0
Share

Also, I tested it out and it works great! Can I get your email so we can talk a little bit further? Or we can do it right here if you like.

First, the issue. I have objects parented to different bones. When I run an animation, they stick to the bones perfectly and all is good. When I use this, the objects are still connected to the bones, but they shift at a different rate than the bones. Do you know why this is?

avatar image Doneyes · Aug 29, 2012 at 12:52 AM 0
Share

And next, how can I edit this so it only rotates on the Y axis with the camera?

avatar image
0

Answer by vinod.kapoor · Aug 29, 2012 at 05:11 AM

if the objects are the children of the the bones as u said, there movement should be proportional to the bones, however if they are up in the hierarchy they will move according to the main gameObject.

Comment
Add comment · Show 2 · 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 Doneyes · Aug 29, 2012 at 10:48 AM 0
Share

Then I have a glitch. This afternoon can I make a video and give it to you?

avatar image Doneyes · Aug 29, 2012 at 09:43 PM 0
Share

Okay. It is seen here.

http://www.youtube.com/watch?v=f-qpFwrWi5Y&feature=youtu.be

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

9 People are following this question.

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

Related Questions

Importing a armature from blender to unity ruins the models rotations -1 Answers

blender to unity animations 1 Answer

Can Unity import a Blender deformed bone rig (segments)? 1 Answer

Remove bone from animator/rig 0 Answers

Can't move mesh limbs? 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