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
1
Question by Maccyjam · Nov 26, 2013 at 11:07 PM · 2dcollisionrigidbody

2D Smooth Collision, Prevent Player from Clipping Through Wall

I'm using the new 2D features found in Unity 4.3 and my character sprite is using a Polygon collider and Rigidbody2D and my wall is using a Box Collider.

When moving into a wall, the character 'clips' through slightly as if it is trying to force its way into the wall pushes it back so obviously this isn't very smooth. Also, if enough force is applied from the character, it is possible to move the character sprite entirely through the wall itself.

I am not using any code to handle collisions, just the colliders and rigidbody.

Can anyone offer any insight as to how to make this look smoother? For example, stopping the player from moving any further if they are next to the wall?

Thanks

Comment
Add comment · Show 2
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 Spinnernicholas · Dec 03, 2013 at 12:40 AM 0
Share

knock, knock. How goes it?

avatar image Davinelulinvega · Jan 31, 2014 at 08:08 AM 0
Share

Hey. I have a simmilar problem with my rigidbodies. I tried everything in the inspector and making new physics material. I tried raycasts but that failed in other aspects. Did you manage to controll this bounciness somehow?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Spinnernicholas · Nov 26, 2013 at 11:31 PM

There are 2 properties of rigidbodies that you can change for smoother effect.

 Rigidbody2D.collisionDetectionMode

and

 Rigidbody2D.interpolation

See Documentation.

Comment
Add comment · 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 Maccyjam · Nov 26, 2013 at 11:47 PM 0
Share

I've tried messing about with these settings in the Inspector, but they don't seem to do anything visibly different. Any suggestions?

avatar image Spinnernicholas · Nov 26, 2013 at 11:51 PM 0
Share

The next step is to modify the Physics$$anonymous$$aterial2D of the player and other rigidbodys.

Physics$$anonymous$$aterial2D

Try setting bounciness to 0.

avatar image
0

Answer by GDFenna · Jun 29, 2014 at 07:51 PM

thanks spinner this smoothed my 2D collider collisions

rigidbody2D.collisionDetectionMode = CollisionDetectionMode2D.Continuous; rigidbody2D.interpolation = RigidbodyInterpolation2D.Extrapolate;

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

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

20 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

Related Questions

2D Mouse Look with Collisions 1 Answer

How can I make a non-player character (rigidbody) move when they touch the ground? 1 Answer

2D Collision Between Sprites 0 Answers

where to trigger which collision event? 1 Answer

2D motion/collision: physics, or direct translation? 2 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