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 /
avatar image
2
Question by jakekosmom · Aug 20, 2017 at 11:31 AM · movementrigidbody2dvelocitystutter

Stuttering/jerky movement of kinematic rigidbody 2d moving by velocity in 2D game on iOS

Hi, I'm working on a 2D game (unity 5.6.3) that has obstacles moving from right to left with a stationary camera and a player that moves only along the y-axis. I have this problem where the obstacles periodically stutter (or shift backwards and forwards) when moving every 2-5 seconds or so. It is hard to notice for some people, but I always see it.

Each obstacle is moved by a parent object with a kinematic rigidbody2D (interpolation is on) by setting the obstacles velocity once when the object in set to active and has two child objects that each have a box collider 2D. I have the obstacles in a pool (a stack) and they are added back to the stack when they are not needed and then popped back when the are needed.

Their movement is like so inside update (but is only called once when canMove):

 if (!hasStartedMoving && canMove && !isDead) {
             rigidbod.velocity = Vector2.left*(moveSpeed*addedSpeed);
             hasStartedMoving = true;
     }

Note: I also see the same stuttering if the movement is by transform.Translate

I have a few TextMeshProUGUI objects with text that pops up as the game plays and sometimes this can occur at the same time as the stuttering, however a lot of the time the stuttering happens on its own. There is one level/scene in the game that is loaded again after game over and I have noticed that the stuttering gets less frequent and sometimes doesn't occur after a few minutes, so I was thinking perhaps it's something to do with text meshes?

I have attempted profiling in the editor as well as on the device, but do not see any spikes (I could be wrong) in performance that correlate with the stuttering. I also can't seem to find any drops in fps below 60 (I also can't see any vsync, which I don't know why), so i'm quite confused about the stuttering.

Here are some screenshots of profiling with an iPhone SE of some spikes (although they are below 60fps).

alt text

alt text

I also see "Unaccounted time between: ..." quite a lot Does anyone have any ideas as to how I may fix this stuttering or what may cause this? I am open to any ideas as this has been plaguing me for weeks.

Thanks

screen-shot-2017-08-20-at-65343-pm.png (234.7 kB)
screen-shot-2017-08-20-at-65402-pm.png (233.3 kB)
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 datagreed · Feb 01, 2019 at 04:03 PM 0
Share

Did yo u ever find a solution?

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

98 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

Related Questions

Character won't move (Fixed) 1 Answer

Object jitters when the scene starts 0 Answers

Weird Rigidbody2D.velocity.x problem, float out of control 0 Answers

can't move player rigidbody.velocity 1 Answer

Rigidboy.velocity with integer? 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