• 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 byte89 · Nov 26, 2013 at 09:32 PM · collisionrigidbodycolliderbounce

How to make Sprite not Bounce on Collision (2D)

Hi everyone, i just started my experience with unity a few days ago and i got stuck with this problem that probably for the most of you is a stupid issue.

I'm actually using the 2D setup , trying to make a RPG game FFV like. I've created a Sprite object for the main character,with a 2D Box Collider and rigidbody (setting gravity scale to 0, so it doesn't fall down).

Now, when the sprite collides with another sprite, or a simple Quad Object with another box collider 2D (i've created a custom 2D Physics Material for this last one with 0 friction and 0 bounciness) it bounces back a little, i've tried to look around for long and can't find a way to make the sprite just stop walking with no bounceback.

Can someone help me working this out? Thanks in advance

(PS:I'm using a custom Character Controller 2D to move the character and i'm not making it use the physics for movement so i'm sure it doesn't interfere with the general physics)

Comment
juanitogan

People who like this

1 Show 0
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

6 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Spinnernicholas · Nov 26, 2013 at 10:59 PM

There are settings in the physics options in project settings for the minimum overlap required for a collision, lowering this might help.

Also, check the other settings.

(old) Make sure the you use the same custom Physics Material on your character as well as your terrain.

Comment
juanitogan

People who like this

1 Show 7 · 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 byte89 · Nov 27, 2013 at 12:16 PM 0
Share

i don't know why, but for some reason it doesn't let me apply my custom physics material on the Sprite Renderer Material, i can do that only on collider objects.

avatar image Spinnernicholas · Nov 27, 2013 at 04:20 PM 0
Share

The are two types of materials, rendering and physics. You can't use a physics material on the spriterenderer because it needs a rendering material.

avatar image byte89 · Nov 28, 2013 at 03:43 PM 0
Share

Thank you very much! but as i see a rendering material doesn't have "bounciness" property... i fixed the problem a little using FixedUpdate() function instead of Update() so it doesnt keep bouncing if i keep the arrow pressed. but still i can see a small bounce on the first collision. I don't know where else can i find properties about this?

avatar image Spinnernicholas · Nov 30, 2013 at 12:20 AM 1
Share

You miss understood me, rendering materials have absolutely nothing to do with physics. They only effect what is rendered.

Physics materials are only on colliders. Your character and your terrain should have colliders and all of the colliders need bounciness set to 0.

Character needs bounciness 0 as well as the terrain.

avatar image Spinnernicholas · Dec 04, 2013 at 07:12 PM 0
Share

Updated answer.

Show more comments
avatar image

Answer by brentstrandy · Jan 01, 2014 at 05:46 AM

Go to your PhysicsSettings2D in Edit > Project Settings > Physics 2D. There is a field called Position Iterations... Change it to a higher number (maybe 5 or more). This should stop the bouncing.

Comment

People who like this

0 Show 0 · 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

Answer by Skelworath · Jan 17, 2014 at 03:44 PM

I'm not sure if I get this right, but if you want it to have a rigid body and not be affected by physics at all you can check the "Is Kinematic" box in the rigidbody2D feature.

Comment

People who like this

0 Show 0 · 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

Answer by messem · Sep 07, 2014 at 01:37 PM

Answer about Position Iterations helps in general, but if you have a very dynamic character - you can set him property in Rigidbody2d > Collision detection to Continuous instead of Discrete (but it could affect on your performance, because continuous consumes more resources).

Comment
Corum86
Doughnut_Slayer
Triky313
sleeparrow
kangsangyeon_KR
ukn47k
jacaosborn

People who like this

7 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 kangsangyeon_KR · Feb 25, 2018 at 08:39 AM 0
Share

Thank you I really appreciate your help.

avatar image

Answer by timmahh · Apr 09, 2015 at 10:17 AM

I was having the same problem and I fixed it by putting my movement code in a FixedUpdate as opposed to just an Update.

Comment
truent
PrairieDogSeeksHeart
FurionTheGreatest
Masteraider73

People who like this

4 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 truent · Jan 21, 2016 at 08:35 AM 0
Share

Nice this fixed it

avatar image Obsidanse · Mar 20, 2016 at 04:13 PM 0
Share

Thank you SO much! I think I see why that worked too. I really should use Fixed more often.

avatar image Masteraider73 · Nov 18, 2020 at 09:04 PM 0
Share

I literally went through the pain of signing in to say thank you because you solved my problem chief

  • 1
  • 2
  • ›

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

26 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

Related Questions

Enemy Cube going through walls. 1 Answer

Stop rigidbody from moving after it falls on another rigidbody 1 Answer

Create a compound collider (beginner) 2 Answers

Parent Object 0 Answers

How to stop an animation on collision 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