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
0
Question by TheSaviour · Jul 17, 2018 at 11:14 PM · rigidbodyjittering

Rigidbody jitters during movement

I've been trying to fix this for days and it's driving me crazy. I'm trying to build a clone of this game:

alt text

The concept is simple. There are platforms moving upwards and the player's job is to control the ball and keep it on the platforms. If the ball the ball hits the spiky platform or the spikes at the top and the bottom, the player loses a life.

However, I'm struggling with moving the platforms. The platform that I've created has RigidBody attached and I'm using the function rb.MovePosition(transform.position + transform.up * Time.fixedDeltaTime); in the platform's FixedUpdate() function. The RigidBody component of the platform is set to "interpolate" and "isKinematic" is set to true.

In the earlier versions of this game (which I released for Android and then deleted a year later), the movement of the platform was perfect. The platform smoothly moved from the bottom the screen to the top without any shakyness or jitteriness. However, in the version that I'm working in now, the platforms are pretty jittery in movement.

I originally thought it was because I added a lot more game objects and scripts to my game and made it too complex. So I created a new project and moved the platforms there. Unfortunately, the jitteriness didn't go away.

I've tried all kinds of codes for the platform's movement. I've tried using Mathf.MoveTowards, Transform.Translate, Vector3.MoveTowards but nothing is working (I had to change the FixedUpdate to Update because these aren't using physics properties).

What's going on? Why did my platforms move so smoothly in the previous versions of my game but not in the current work-in-progress version of my game? I know that I used an older version of Unity for the old versions of the game. Could it have anything to do with this?

Another thing you should know is that in the previous versions of the game, I never set the frame rate to a specific value. But it didn't matter because the game ran very smoothly. In this version, I tried setting frame rate to 60 but it was no use. The platforms are still shaking as they moves upwards.

I even played around with the Fixed Timestep. Didn't work.

rapid-roll.jpg (60.1 kB)
Comment
Add comment · Show 4
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 JVene · Jul 17, 2018 at 11:32 PM 0
Share

I don't recognize some issue in your observations, so maybe in this case you should wrap up a zip of the project, post it so some of us could unzip a copy and try it out.

That said, I do think that transform.forward * Time.fixedDeltaTime is not actually a rate. What is the scale of the artwork? This would tend to cause speed to be bound to the fixed frame rate, and I recall that fixedDeltaTime isn't tracking time like deltaTime. Documentation, somewhere I don't recall, states that we should use deltaTime and not fixedDeltaTime, even in fixed update functions. I think, without being certain, that fixedDeltaTime isn't what it seems to be, and might even have changed definition over time.

What I think is better is to consider a rate per second based on the units of your artwork, scale "forward" to that rate, then multiply by deltaTime - but I have no idea of this is central to your problem, which is why I'm not posting this as an answer.

avatar image TheSaviour JVene · Jul 26, 2018 at 11:16 PM 0
Share

Sorry for the late reply. What exactly do you mean by "scale" of the artwork? It's not something I'm familiar with. Also, if I wanted to create platforms which continuously move across the screen during gameplay, then what would you recommend? Update or FixedUpdate? Because I might have read somewhere that FixedUpdate is only suitable for player characters and not spawned characters like platforms in this case.

avatar image TheSaviour · Jul 31, 2018 at 12:58 PM 0
Share

Does anyone have any comments on this issue? I'm suspecting that it has something to do with the newer versions of Unity. I created a new project and re-created my game from scratch. The only difference is that in this project, I didn't include any of the enhancements that I added after first releasing my game. So in other words, I brought my game back to the state where it didn't jitter on Android. I used all the old scripts that the old version of the game had. And guess what, it was still lagging. So I'm guessing that it has something to do with the new 2018 version of Unity that I'm using. Back when I released this game (the non-jittery version), I was most like using Unity 4.8.

avatar image Harinezumi · Aug 04, 2018 at 10:14 AM 0
Share

Hey! I started following your question, because I was interested what is the solution, because based on the description you are using the physics well. I was only puzzled why the platforms aren't set to kinematic. Now that you updated the question (thanks!), I have a suggestion: you could try moving the platform directly with rigidbody.position, as kinematic rigidbodies don't need to care about collisions that much. I'm not sure this will work, but maybe it will.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Sanjay112000 · Feb 14, 2021 at 12:39 AM

I solved it by setting rigidbody interpolation to none

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 BlueDarterz · Jul 31, 2018 at 02:37 PM

I was having a similar issue in my 3d project. Ultimately after trying many things I found it was fixed after ticking "Is Kinematic." It has yet, as fair as I can tell, interrupted any plans or ideas ive implemented. Maybe give it a shot?

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 TheSaviour · Aug 03, 2018 at 10:32 PM 0
Share

I apologize. I made a mistake in the description. I actually had iskinematic set to true this whole time. I edited the description.

But it doesn't matter. The platforms still jitter.

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

121 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

Related Questions

Character Controller Jittering 0 Answers

Rigidbody interpolation conflicts with transform.position 0 Answers

C#: Why does this strange jittering occur?? 0 Answers

Player movement jittery when hitting walls and using Rigidbody.MovePosition. 1 Answer

Rigidbody character clips through or jitters on corners. 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