Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Yemnefer · Dec 04, 2017 at 05:30 PM · 2dcamera-movementtopdowncamera followsmoothfollow

Create a smooth camera without jittering/flickering in 2D

I searched a lot and I can't find the answers, I have a Cinemachine camera, my character and a parallax, my parallax moves smoothly in the Scene view so I can conclude that the problem is in the camera . If I remove the cinemachine and just make the camera follows the player, It jitters with it and the issue is "gone" : https://imgur.com/a/wFnQt

but if I smooth the movement, with Cinemachine or not, the parallax starts flickering because of the camera and the player movement: https://imgur.com/a/yaRLh

I've already tried:

  rb2d.MovePosition(rb2d.position + movementVector * speed * Time.smoothDeltaTime);
 //transform.position += new Vector3(input_x, input_y, 0).normalized * speed * Time.deltaTime;
 //rb2d.velocity = new Vector2(Mathf.Lerp(0, input_x * speed, 0.8f),Mathf.Lerp(0, input_y * speed, 0.8f)).normalized;

rb2d:

  • Interpolate/extrapolate

PlayerMovement:

  • FixedUpdate

  • deltaTime

  • fixedDeltaTime

  • smoothedDeltaTime

CinemachineBrain:

  • UpdateMethod

How can I make the camera moves smoothly with the player, and my parallax works fine?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Adam_Myhill · Dec 05, 2017 at 01:07 AM

My guess is that your character is moving in a jittery way. Locking the target to the character hides the jitter because the camera effectively jitters along in lockstep with the choppy motion.

Cinemachine damping can expose character translation issues because it smooths the camera movement out which reveals the jitter.

How are you translating the character? Fixed update? Interpolation? Without seeing what's going on that's my best guess. We've had a lot of 'Cinemachine jitters' but in the bast majority of cases it's actually the player that's jittering.

On the Cinemachine Brain, there's a few different update option methods. Try those first as it's easiest and they can often reveal what the real issue is.

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 Yemnefer · Dec 08, 2017 at 05:16 AM 0
Share

I'm moving my character with $$anonymous$$ovePosition as you can see, the other options is what I've already tried. I've tried Fixed Update in the code, and change the CinemachineBrain Update$$anonymous$$ethod, switch Interpolation or Extrapolation and much more. If I double F my player I can clearly see that he is the cause of the jittering. The script is currently like this without the Cinemachine and temporarily my camera is just attached to the player: https://pastebin.com/Y9sj5mYu , I searched a lot, and I'm pretty sure that the problem is with the player's movement, but I've not been able solve the problem. Thanks for the Help!

avatar image
2

Answer by LAKSHAYMAVIA · Mar 23, 2019 at 08:09 AM

Changing the interpolation in rigidbody2D component work for me.

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 hgbimonti · Mar 23, 2021 at 04:57 PM 0
Share

Great! Changing the character Rigidbody's Interpolate to Interpolate fixed it.

avatar image
1

Answer by sudoman281 · Feb 15, 2018 at 09:50 PM

I was trying to track a physics driven object, so changing Update Method to Fixed Update helped.

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 forewar · Feb 27, 2018 at 10:18 PM 0
Share

The same I have a physics character. Changing to Fixed Update in $$anonymous$$ainCamera Cinemachine Brain helped me. Thanks!

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

191 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

C# Smooth Follow Space Ship 1 Answer

2D Sample Camera Script malfunctioning 0 Answers

Adding small acceleration to 2d top down movement game? 0 Answers

What is the best solution for infinite tile generation in a 2d top down game? 0 Answers

2D Movement Controls Like a Dying Fly 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