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 Rybo5000 · Oct 15, 2012 at 05:21 AM · rotationjavascriptquaternionangles

Rotation using Quaternion.Lerp

I'm following a tutorial on youtube by unitycookie, he gave the following line of code to look at a target:

 gameObject.transform.rotation = Quaternion.Lerp(currentRotation, desiredRotation, Time.deltaTime * turnSpeed);

alas it doesn't seem to work for me, the object does turn but it doesn't face it's target, it's usually about 90 or so degrees off.

Note: it's never exactly 90 degrees off so it's not a consistent error it seems

Comment
Add comment · Show 12
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 whydoidoit · Oct 15, 2012 at 06:17 AM 0
Share

Just for future reference - here's a tutorial on using Quaternions for a bunch of things including Look Ats when the objects involved don't look down forward by default etc.... UnityGems.com

avatar image Fattie · Oct 15, 2012 at 03:42 PM 0
Share

@whydo ... here's a great example of a customer that deeply needs a Unity Gems Gem ... :-O

http://answers.unity3d.com/questions/332824/acceleration-and-deceleration-of-an-object.html

avatar image Fattie · Oct 17, 2012 at 05:40 AM 0
Share

@whydo .. UG Triumph !! -->

http://answers.unity3d.com/questions/333195/rotate-90-degrees-question.html

you ROC$$anonymous$$ !

avatar image whydoidoit · Oct 17, 2012 at 05:44 AM 0
Share

Hey did you have any comments on my beginner mistakes article?

avatar image Fattie · Oct 17, 2012 at 05:46 AM 0
Share

holy GOD man ... you did a new article already ?

Now you are just making ordinary people look bad. hang on !!

Show more comments

1 Reply

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

Answer by Rybo5000 · Oct 15, 2012 at 06:02 AM

Turns out the problem was quite simple, the target wasn't positioned correctly.

It was too small and too far away for it work properly.

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 Fattie · Oct 15, 2012 at 07:32 AM 0
Share

go to UnityGems.com for this

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

11 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

Related Questions

A little help with this camera script please? 3 Answers

Finding A Rigidbody's Rotation Speed And Direction 2 Answers

Whats the Difference Between Rotation EulerAngles and Quaternions? 2 Answers

Lerp with raycast hit.normal? 2 Answers

Rotating to Slope 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