• 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
Question by fernandopal · May 05, 2020 at 12:31 PM · physicsrigidbodybounce

Rigidbody bounces back on collision

Hello everyone, I have a scene with a player (capsule collider + rigidbody + camera + my movement script) and a cube (cube collider + rigidbody).

Every time that the player walks and join a collision with the cube it bounces back if the cube doesn't have space to move in the direction that is being pushed

Here is a video showing the bouncing https://youtu.be/zlB8ozMFozQ (when i go back im not pressing any button, its just the bounce)

I don't want this to happen, i just want that if the player is moving the cube and it has no space it just stops moving, that bouncing is annoying and i dont know how to remove it. Can someone help me?

Tganks in advance guys.

Comment
MilitaryG
logicandchaos

People who like this

2 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 MilitaryG · Jun 27, 2021 at 02:13 PM 0
Share

I have same issue my character bounces of the cube if it collides on it I'm moving player with Rigidbody but I still have same issue is there any other way to solve this problem

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by b4guw1x · Jun 28, 2021 at 12:49 PM

Did you try to increase the drag or increase the mass of the player?

Comment
MilitaryG

People who like this

1 Show 2 · 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 MilitaryG · Jun 28, 2021 at 03:04 PM 0
Share

yes I have tried to increase the mass and decrease the mass but how to increase the drag?

avatar image MilitaryG · Jul 02, 2021 at 03:26 PM 0
Share

yes I just increased the drag and it works flawlessly it doesn't bounce any more drag is under the mass

avatar image

Answer by Bicsi · Jun 28, 2021 at 10:52 PM

Without seeing your scripts, i think i have an idea of what is happening. This has nothing to do with any kind of bouncing mechanics from the rigidbody or any other component. If you wrote the script yourself, you should be able to find it quite quickly. To stop a rigidbody from forever adding a force when walking into a wall, you could add a directly opposite force to stop the character from accelerating forever. Without being certain, i think this opposite force is being added wrongly.

This could also be a case of the rigidbody of the cube acting weird when colliding with the wall. It could be shaking every so slighty, and adding a force back to your player. The Rigidbody physics can be very "wonky" at times.

Increasing the drag of your Rigidbody could greatly reduce this i believe, but it would not really make the problem disappear, just simply reduce the problem. But try looking at the rigidbody component. Right under the "Mass" you have "Drag" which rougly translates to the friction between your character and the ground. Perhaps also try increasing the masses of your objects to more realistic scales, such as 100 for the player and 10 for the cube. That could potentially also stop any weird physics studdering.

If this is not the solution, please do share a link to your script, so we can get a peek at the movement :-)

Comment
MilitaryG

People who like this

1 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 MilitaryG · Jun 29, 2021 at 03:23 PM 0
Share

my planet movement it has more than only Rigidbody witch is on the end of the script. it also has the planetary gravity and move around the sphere witch works fine. also I tried few other aproches like:

transform.position = Vector3.MoveTowards(transform.position, target.position, step);

RigBody.velosity = newPossition

but they also bounce me of the planet. to make that script work you need to make big sphere and non rigidbody cube in front of you and when you hit the cube it starts bouncing also I don't want for cube to move I only want to stop moving when I hit cube

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

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

Disable bouncing effect 0 Answers

How to make objects non-penetrable, inelastic 0 Answers

Making Pong 1 Answer

Changing physics properties of a gameobject through code. 1 Answer

RIGIDBODY HOW MAKE IT STOP BOUNCING HELP! 3 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