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 RickyX · Mar 11, 2014 at 07:13 PM · lookatbone

Bone look at.

Is it posibble to make bone look at something, there's transform.SetLookAt which makes character's head look at something, is it posibble to do it with some other bone ? I really need this !

Comment
Add comment · Show 6
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 Griffo · Mar 11, 2014 at 07:25 PM 0
Share

Here

avatar image RickyX · Mar 11, 2014 at 07:28 PM 0
Share

There tons of things in it, any other simple way of doing this ? And i won't give my money for it.

avatar image raybarrera · Mar 11, 2014 at 07:45 PM 0
Share

Is there any reason you can't just do that-- bone.transform.LookAt for another bone?

avatar image RickyX · Mar 11, 2014 at 07:49 PM 0
Share

Nope, it just won't work. $$anonymous$$aybe becouse it's busy with the animation ?

avatar image Griffo · Mar 11, 2014 at 08:37 PM 0
Share

Here and Here might help ..

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Benjames · Mar 28, 2015 at 03:55 PM

So if you have a LateUpdate() function and put bone.transform.LookAt(position); in it so its effected after the animation.Then if it doesn't line up correctly you can always put something line this *

 bone.transform.rotation=bone.transform.rotation * AngleAxis(90,Vector3.Up);
 
 or
 
 bone.transform.rotation=bone.transform.rotation * AngleAxis(90,Vector3.Left);

to rotate the bone on an axis.

This is what I used to get my character to point his gun at the aimers position correctly.

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 Benjames · Mar 28, 2015 at 03:57 PM 0
Share

I spent a long time messing with this a while back to no avail. Then I did a little research on Quaternion rotations, watched a couple videos and what not. It really helped because I came back to this and got it working in $$anonymous$$utes.

avatar image Owen-Reynolds · Mar 28, 2015 at 04:22 PM 1
Share

This is basically "how do you LookAt using something besides the Z axis?" The way is to find the difference between the LookAt you want, and your +z; do the LookAt; then adjust.

The adjustment is a rotation, so is a Quaternion. Can get it using Quat.Euler, or AngleAxis, or can make an empty pointing the correct way and take the inverse of the localRotation ... . Probably more ways.

$$anonymous$$ost non-bone solutions just use parenting to make +Z be the way you want to look.

avatar image RickyX · Mar 28, 2015 at 07:06 PM 0
Share

Ehh thanks i guess but this is kinda old, found a solution long time ago. It could sure help other people.

avatar image RickyX · Mar 28, 2015 at 07:06 PM 1
Share

Can't test if it works so i can't give you a right answer tick

avatar image Benjames · Mar 28, 2015 at 07:40 PM 0
Share

Thats fine, I was just saying that you can adjust the rotation after using LookAt(); to make the bone face the right direction.

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

24 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

Related Questions

Bone lookat do not work Help! 1 Answer

Questions about Head Look Controller 0 Answers

What is the best way to let a character follow a moving object with his head 0 Answers

How to rotate bone relative to camera using LookAt 3 Answers

Stop LookAt Function. Lock the rotation 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