Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 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 /
avatar image
1
Question by onculy · Oct 31, 2014 at 06:29 AM · camera-movementchoppyspike

Unity3D Choppy Camera Motion

I tried many different methods but never succeed to make a perfectly smooth camera movement. Even in a very simple scene, camera follow is not good enough. There are hiccups in motion. Hiccups do not occur periodically but randomly. If I didn't know some games(e.g. Manuganu) made in unity and has a perfect camera follow, I would think it is impossible. My scene is so simple, there are sprites, target character and camera. Target character seems normal always, but all other things jitter for a very short time, randomly, but disturbing.

What I have tried so far: -Change camera position in LateUpdate/FixedUpdate. -Made my target interpolate/extrapolate. -Moved camera depending on Deltatime. -Increased physics steps. -Set the targetframerate = 60. -Played with all Quality settings, Vsync etc. -Many variations and other things...-there is no GC issue

The best scenario is, random hiccups...happening in both mobile and editor. Unity's example scripts doesn't work perfectly smooth either. I can't continue developing sidescroll runner game because of this hiccup problem.

The question is: is there any way I didn't mention, is there any example on the Internet? I did everything I can do.

transform.position = new Vector3(target.x, target.y, -10); This is how I update camera position in LateUpdate.

PS: There is no FPS drop issue.

Comment
Add comment · Show 5
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 XinJinXiang · Mar 24, 2015 at 02:30 PM 0
Share

Have you solve this problem? I encounter same problem at this moment. If you fix this issue,please provide solution.

avatar image onculy · Mar 25, 2015 at 07:40 AM 0
Share

Still didn't find a solution and newer versions make it even worse. So I'm still using 4.6.

avatar image XinJinXiang · Mar 25, 2015 at 08:17 AM 0
Share

I am working on urgent project for TV broadcasting. And it requires high detail graphics and perfect camera smooth moving. Also I tried to many ways to fix this problem but I can`t find suitable solution.

avatar image knarola · Aug 08, 2015 at 05:39 AM 0
Share

I have encountered with the same problem. Still didn't find the solution. Did anyone get it?

avatar image pineco222 · Nov 13, 2021 at 02:16 PM 0
Share

Do you get stutter when you move character and mouse in the same time?

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Socrates · Mar 25, 2015 at 08:38 AM

Have you tried using smoothing on the camera? This way when the player moves suddenly, the camera moves to follow, but flows more evenly.

The following is based on the code from the Survival Shooter tutorial in the Unity Learn section. The code goes on the camera. The "target" is the player.

 using UnityEngine;
 using System.Collections;
 
 public class CameraFollow : MonoBehaviour 
 {
     public Transform target;
     public float smoothing = 5f;
 
     private Vector3 offset;
     
     void Start()
     {
         offset = transform.position - target.position;
         // Or do offset = new Vector3(target.x, target.y, -10);
     }
 
     void FixedUpdate()
     {
         Vector3 targetCamPos = target.position + offset;
         transform.position = Vector3.Lerp(transform.position, targetCamPos, smoothing * Time.deltaTime);
     }
 }
 

Comment
Add comment · Show 4 · 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 onculy · Mar 25, 2015 at 08:43 AM 0
Share

Believe it or not, I tried anything similar to your suggestion so far. I think the problem is with the game engine. You can have look at angry bots (example project comes with unity), It has the same issue but you may not recognize it until I say because it is not that important in such kind of a game. But if you are making something like flappy bird, it hurts. Honestly, I don't think there is a solution currently. Thanks for your advice anyways.

avatar image onculy · Mar 25, 2015 at 08:46 AM 0
Share

By the way, it may not be a camera follow issue. Just put a box with rigidbody and set a velocity then watch. You will see random hiccups.

avatar image Socrates · Mar 25, 2015 at 09:05 AM 0
Share

I have played the Angry Bots demo on multiple versions of Unity and not had a problem with choppy camera in any of them.

Try making a build of the game and running it outside of the Unity editor. Sometimes things do now work properly in the editor.

Also, garbage collection can cause issues as the game hangs for a moment when a bunch of garbage collection happens. If you are creating and destroying a lot of objects over and over, look into object pooling.

avatar image onculy · Mar 25, 2015 at 09:10 AM 0
Share

Thanks for info. I know all your sayings and very low level issues. I tried angry bots with several devices, it is not easy to recognize it in angry bots but it happens. Note: you are right. it is not generally possible to have a good motion in the editor but devices.

avatar image
0

Answer by Hrungdak · Mar 25, 2015 at 09:16 PM

Difficult to analyse without more information. If you bind your camera to the character in this way, every "hickup" of the character transforms 1:1 to the camera. And the effect is, that the camera and the character seem not to "hickup", but everything else does.

I would recommend either decoupling the camera from character by running some code to smooth the camera movement or searching for the error in the character movement.

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

Answer by XinJinXiang · Mar 25, 2015 at 08:50 AM

Yeah, as onculy mentioned above it is not camera follow issue. I tested in empty scene with simple cube many times. Also it moves well if you don`t want perfect camera moves. But I need perfect and smooth move for TV broadcasting.

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 knarola · Aug 08, 2015 at 05:16 AM 0
Share

Did anyone get the solution, i am facing the same problem mentioned in the main question. I have tried everything available on internet. Please post the solution if anyone has found it.

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

32 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

Related Questions

Cloud recognition in Vuforia 0 Answers

how to export unity project to the eclipse program 2 Answers

Problem with set fullscreen in webplayer 0 Answers

Collision detection on cube with third person camera 1 Answer

Set Active To Prefab 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