Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Mikeysee · Mar 10, 2015 at 08:15 AM · movementrigidbody2dphysics2djerky

2D Motion Jerky using RigidBody2D [Video]

Hi,

Yes this is yet another jerky motion question but all the others dont seem to solve it so here goes.

I am using a RigidBody2D to control the movement of my main character but for some reason the movement is not smooth, the player jumps around a lot, I have tried the various Interpolate methods and Extrapolate seems to smooth things out but it seems to have a large performance hit on mobile.

See the video to see what is going on: https://www.youtube.com/watch?v=lFuuiQ2r8gM&feature=youtu.be

Does anyone have any idea how to go about fixing this?

Mike

Comment
Add comment · Show 14
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 hexagonius · Mar 10, 2015 at 09:04 AM 0
Share

How do you move it?

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

On mobile you should not use physics.

avatar image hexagonius · Mar 10, 2015 at 09:22 AM 0
Share

@hypnoticmeteor not true. Angry Bird uses Box2D physics, on mobile, and it works perfectly. Bad Piggies is all about physics.

avatar image hypnoticmeteor · Mar 10, 2015 at 09:38 AM 0
Share

I saw it on Unity somewhere it is not good to use physics. I have tried it myself reduces the main thread dramatically. Its not that you cannot use physics but if you have a low end phone it causes lag which could be a reason why OP thinks it has a jerky motion.

Yeah you are right they use physics but you cannot control them once you shoot them into the air. In this case OP is controlling them with physics which is not a good idea.

avatar image hypnoticmeteor · Mar 10, 2015 at 10:10 AM 0
Share

Try the physics option in Project setting and try to change Bounce Threshold it might solve your problem.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Xeong-Hu · Mar 10, 2015 at 09:17 AM

If you're using Unity3d 5.0 Try checking off "Apply Root Motion" in your Animator of the game object, and see if that helps.

Btw nice game man.

Comment
Add comment · Show 5 · 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 Mikeysee · Mar 10, 2015 at 10:00 AM 0
Share

Thanks. Im using 4.6 and have now ticked it off and the problem persists :(

avatar image hexagonius · Mar 10, 2015 at 10:02 AM 0
Share

Could you show that code that is moving it?

avatar image Mikeysee · Mar 10, 2015 at 10:18 AM 0
Share

@hexagonius its going to be quite tricky to create a simple example to show you. Basically its just a Rigid2DBody thats moving. If I remove the forward velocity code and just leave the jump logic (simple adding a force) then the problem still persists.

Changing the Fixed Time Step value in Time$$anonymous$$anager settings helps it. So too does setting the interpolate value on RigidBody2D to Extrapolate but both increase the performance cost :(

avatar image hexagonius · Mar 10, 2015 at 10:28 AM 0
Share

From what you're showing in the video there's no reason to change physics settings, there is not nearly enough stuff happening. The problem must be something else. Just some considerations:

  • $$anonymous$$ake changes to the rigidbody's velocity in FixedUpdate()

  • If adding forces continuously and using Force$$anonymous$$ode.Force, also use FixedUpdate()

  • Use interpolation mode on the rigidbody2d

  • Add a Physics$$anonymous$$aterial to the Collider with no friction at all

  • Adjust CameraPosition in LateUpdate();

avatar image Mikeysee · Mar 10, 2015 at 10:36 AM 0
Share

@hexagonius Thanks again for all those tips.

I am continuously applying force in FixedUpdate but I was not using Force$$anonymous$$ode.Force, I am now doing so.

I didnt want to use interpolation mode due to the performance cost but I guess I may have to.

I have no friction on the Physics$$anonymous$$aterial.

I do adjust camera in LateUpdate already

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

24 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

Related Questions

Rigidbody2D doesn't move 0 Answers

Weird behaviour after Collision? 0 Answers

Move an object via Rigidbody2D Physics and Transform at same time 0 Answers

Child GameObject can't use MovePosition on parent's Rigidbody2D? 3 Answers

Issues with Character Controller moving Enemies 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