Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by SadSwede · Mar 10, 2016 at 10:19 AM · cameramovementcharactercharactercontrollercamera-movement

having CharacterController movement in fixedupdate causes jerky movement on camera

Hi, im having a really big headache because of this problem, im been sitting with this for a week and can't find any solution at all.

let's say you take the standard unity FirstPerson-CharacterController asset and put it in the scene, and then start walking in a circle by holding "A" and move the mouse in a direction so that the character makes a circle,now if you look at the ground infront of you on the terrain, it starts tearing, and all the movements is jerky and laggy(EVEN WITH HIGH FPS).

and when i change and put all the movement code in the update() function istead of the FixedUpdate()(wich you shouldn't do) it becomes smooth as hell, but then the problem instead is that when i get high fps i run faster and with lower fps i run slower, i literally think im gonna die, im so freaking mad please help me.

i have a good setup, good monitor and mouse and keyboard. nothing is wrong with my setup.

Comment
Add comment · Show 2
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 Positive7 · Mar 12, 2016 at 12:40 AM 0
Share

Have you tried turning on the Interpolation on the character under Rigidbody? http://docs.unity3d.com/ScriptReference/Rigidbody-interpolation.html

avatar image SadSwede Positive7 · Mar 12, 2016 at 01:40 AM 0
Share

Hello, thank you for answering, and yes i have tried that, it is still laggy and im not really using rigidbody, only a charactercontroller and the standard script for the physics..

please if you have any other solution ANY i really need to know :/

3 Replies

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

Answer by big_rip · Jan 04, 2017 at 12:09 AM

This is old, but I still had this issue in 2017. What helped me:

  • set Fixed Timestep to 0.008333334 (120 FPS)

  • turn V-Sync on

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 SadSwede · Jan 06, 2017 at 04:48 PM 0
Share

HOLY JESUS, this actually worked out !!!!!!!

i am so glad you gave this information, thank you so so so much!

avatar image hexagonius SadSwede · Jan 06, 2017 at 07:15 PM 0
Share

just want to let you know that this is not a very good solution. running physics faster cost more performance and the only reason one should do that is when collisions are not properly solved anymore.

avatar image
0

Answer by hexagonius · Mar 12, 2016 at 04:38 PM

If you run on different speeds if framerate differs the movement is not delta time based. whatever way you calculate the moving speed, multiply it with deltatime. another thing could be the camera that is not repositioning (if it's a follow cam) in LateUpdate instead of any other update

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 SadSwede · Mar 12, 2016 at 04:44 PM 0
Share
     void $$anonymous$$ovement()
     {
         float speed;
         GetInput(out speed);
         // always move along the camera forward as it is the direction that it being aimed at
         Vector3 desired$$anonymous$$ove = transform.forward * m_Input.y + transform.right * m_Input.x;

         if (m_CharacterController.isGrounded)
         {
             m_Jumping = false;
         }

         if (m_CharacterController.isGrounded)
         {
             m_$$anonymous$$oveDir.x = desired$$anonymous$$ove.x * speed;
             m_$$anonymous$$oveDir.z = desired$$anonymous$$ove.z * speed;

         }

         m_CollisionFlags = m_CharacterController.$$anonymous$$ove(m_$$anonymous$$oveDir * Time.fixedDeltaTime);

         //UpdateCameraPosition(speed);

         if (!m_CharacterController.isGrounded)
         {
             if (anim != null)
             {
                 anim.SetBool("Falling", true);
             }
         }
         else
         {
             if (anim != null)
             {
                 anim.SetBool("Falling", false);
             }
         }
     }

this is my movement function, what should i change? ( i update this in the Update function)

avatar image Taza494 SadSwede · Mar 18, 2016 at 03:34 PM 0
Share
 m_CollisionFlags = m_CharacterController.$$anonymous$$ove(m_$$anonymous$$oveDir * Time.deltaTime);

changing Time.FixedDeltaTime to just Time.deltaTime might solve your issue, if not it might be within m_CharacterController's $$anonymous$$ove function.

avatar image
0

Answer by collederas · May 10, 2020 at 09:37 PM

Hey, it's late but for anyone dealing with the same problem, I think this blog post will be interesting:

http://www.kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8

Comment
Add comment · 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

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

7 People are following this question.

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

Related Questions

How can i smooth out my Camera / Player Movement 2 Answers

Move Direction Based on camera position not working correctly (3D) 0 Answers

FPSController - Smooth Movement 0 Answers

Mouvement issue with mouse input. 0 Answers

How to make the player change it's rotation according to the camera,Making the player look forward when rotating 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