Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 peachvirgo90 · Aug 31, 2021 at 03:10 PM · tilemapcollision2dphysics material

Player gets stuck when using precise collision shapes

Hi all,

I have some very precise shapes in my 2D tileset that my player has to walk around. I've made the custom physics shape for these tiles match the outline of these shapes in the sprite editor so the collision can be as accurate as possible.

However, my issue is that the player is getting stuck very easy when walking around and in between these shapes on the map.

I could probably solve this by smoothing out the collision outline shape, but because my shapes are very precise, the collision won't be as accurate. So I'm not sure I like that idea.

Are there any other ways I could overcome this? I've been messing about with physics materials to see if I can add something that makes the player walk across without getting stuck so easily. Adding bounciness is one I tried which kind of works but I'm not sure I like the jitteriness effect that adds. Anyone know of anything?

Comment
Add comment · 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 Riiich · Aug 31, 2021 at 06:12 PM 0
Share

Could you post a few images of the colliders and what happens? :)

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by CoughE · Sep 02, 2021 at 03:01 PM

Usually collision shapes in video games are simpler and smoother than the geometry (in this case tiles) they are assigned too for this very reason. If the player is walking a surface that has lots of tiny rock graphics on it, they want to smoothly glide across rather than bump up and down and have to jump over each tiny rock.

Comment
Add comment · 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 rh_galaxy · Sep 05, 2021 at 02:14 PM 0
Share

Yes, it's like if you use pixel perfect graphics, a diagonal line turns into a staircase... You need to smooth it out into a moving-direction, and also have a reasonable transition to all other tiles it may connect to.

avatar image
0

Answer by ahsen35813 · Sep 05, 2021 at 02:53 PM

I'm not sure how complex your collision shapes are, but perhaps you can try using circle colliders to match bumps instead of an actual mesh, which might reduce how much your player gets stuck. Another important thing for us to know is what kind of player do you have? Is it physics based or a custom player movement implementation? Physics based might allow it to bounce over things instead of getting stuck, even without bounciness.

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

132 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

Related Questions

How to the detect what side of the player is colliding with a object in a tilemap 2 Answers

2D tilemap building game top-down,2D TopDown Building game with tilemap 0 Answers

How can I find the name of the tile that I collided with in 2d? 1 Answer

Tilemap collider doesn't appear 1 Answer

Stuck Between tilemap colliders 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