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 Inan-Evin · Jan 02, 2015 at 02:25 PM · rotationupdatelerpfixedlate

Which functions to which update, got confused

Well hi everyone, i have a real quick question for you. I know the script order, I know what FixedUpdate, Update and LateUpdate are. But i got confused about somethings, it's just complicated for me for now. Let me explain what my system is :

I got a character, it moves with rigidbody. All rigidbody movement lines are in FixedUpdate. And in Update, i check whether velocity is higher than a value or not, in order to detect if isMoving.

As a child object, I got a camera. Now, in the camera scripts, i have some quaternion.lerps lines. What i do is, if character's isMoving is false, i only let camera to be rotated ( free look while player stands still ) by Quaternion.Lerp, in both x and Y axis. If character's isMoving is true, i rotate the player body's y rotation, and rotate the camera's x rotation, by using Quaternion.Lerp and achieve a casual fps style camera controls.

So everything works fine but there can be some shutterings or glitches, and i assume that these can be caused because of the misconnection between updates. According to my situation, in which update should i put those camera script's camera and player lerping codes ? I tried all three but couldn't succeed, maybe I should change some of the lines only, like camera lerps to late update but player lerps to fixed or normal update. Something like that, got stuck, anyone ? Thanks :)

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 EvilTak · Jan 02, 2015 at 06:18 PM 1
Share

From experience, camera rotation should always be in LateUpdate.

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

26 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

Related Questions

lerp to 0, problem with horizontal value 1 Answer

Updating at frameRate some fixedUpdated gameObject 1 Answer

Unit rotation fails consistently on all slerp rotations after the first? 0 Answers

Mathf.Lerp working in one direction but not the other 1 Answer

Lerping euler angles make entire spin 3 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