• 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
0
Question by victoroliveirab · Jun 11, 2018 at 09:07 PM · physicsrigidbodyvelocity

,Two Similar Rigidbodies with velocity behaving differently

Hello fellas,

This is my very post here so I apologize in advance for any mistakes or misuse of a tool. I'm new to Unity and am trying to design a very simple game here. For the mechanics, the two key components are a rectangular pad and a cube.

Screenshot

They are both given the same initial velocity of 5f in the z-direction (to the right in the image) Unless I either specify it on code (C#) or a collision with an obstacle occurs, I want the cube to maintain this velocity.

However, it seems like in some frames, its velocity rapidly decays and then comes back to the former velocity (this behaviour can be confirmed via console) and, eventually, the pad reaches the cube and also surpass it.

I've tried to solve this issue via Script Execution Order, exchanging Update with FixedUpdate and vice-versa, adding Physics Materials; all with no luck.

Important to highlight: I'm assuming the difference of functioning is due to the pad being a trigger and the cube is a collider (no "is trigger" marked). But with no friction, no drag nor angular drag, and constantly update via script, I expected the velocity to be constant.

Has anyone had the same issue and found a workaround? Am I missing something?

screen-shot-2018-06-11-at-54133-pm.png (67.3 kB)
screen-shot-2018-06-11-at-54133-pm.png (67.3 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by UnbreakableOne · Jun 11, 2018 at 09:15 PM

I don't know the answer, just my opinions that might help somehow, hopefully.

  1. I can't test if right now but I'm assuming you're using Kinematic rigidbodies, right?

  2. Do you need to have rigidbodies? Whenever I need complete control over an event, I tend to do the math manually, like collision detection. Maybe you could achieve the same effect without them.

  3. Also does this happen on the builds as well? Maybe an Editor thing?

  4. What about the ground object, maybe it has friction. Did you try applying the same friction-less material to it as well?

  5. I'm sure you've tried testing it in a new project, assuming anything you might've changed in the Physics section would interfere here.

Comment
Add comment · Show 3 · 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 victoroliveirab · Jun 11, 2018 at 09:27 PM 0
Share

Thank you for your quick reply, I will answer all the topics you lifted. 1. The platform is a $$anonymous$$inematic rigidbody, as I don't want gravity to affect it. The cube and the pad are moving, so I don't understand how I'd use $$anonymous$$inematic here (I always use $$anonymous$$inematics when I want the body to have colliders but keep its position). So, both of them are set to dynamics. The pad, however, has its x and y-axis Freeze Position activated. 2. I think I could do the math manually, but am trying to stick to the Physics Engine. I need at least the cube's rigidbody, because it jumps and falls. I would implement the math myself only in a last resource. 3. Didn't understand what you meant by "builds". The platforms (in 'brown') are fixed, and the backpad is a trigger, so it doesn't "bump" on anything. 4. I tried setting the platform (ground) to 0 static and dynamic friction, 0 static and 1 dynamic friction and vice-versa. No success :/ Currently, none of the objects have physics material. 5. I tested a similar thing with a sphere in a different project and things worked out there. Perhaps due to the different contact surface?

Anyway, thanks for the insights!

avatar image victoroliveirab victoroliveirab · Jun 11, 2018 at 09:28 PM 0
Share

Can't seem to breaklines correctly :/ sorry for the mess

avatar image victoroliveirab · Jun 12, 2018 at 03:07 AM 0
Share

I got what you meant by "builds". Just deployed it on a spare android phone I have and the problem persists, although it's perfor$$anonymous$$g (just a visual opinion) a little bit better. On the other hand, both objects keep backtracking a little, looking as they are "correcting" their positions. Still luckless and clueless :/

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

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

Proper way to set a RigidBody's maximum velocity 1 Answer

Make a "Balloon" that floats upwards but slows as it gets higher 1 Answer

Why Does Bounciness Affects Rigidbody Velocity? (SOLVED) 0 Answers

Counteracting rigidbody velocity using AddForce? 0 Answers

Rigidbody.velocity Movement code produce wildly different gravity interactions 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