• 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 Cains · Jan 10, 2020 at 06:55 PM · collisionphysicsterrainterraincollider

Terrain collider is inaccurate

I have a terrain with a terrain collider and when I walked around on it I noticed that the collisions seemed inaccurate but almost correct, so I looked at the collision geometry with the physics debugger and found t$$anonymous$$s (collision geometry is in green):

alt text

As you can see, it's mostly correct but very inaccurate in many places on slopes. Is somet$$anonymous$$ng wrong or is there a setting to control t$$anonymous$$s? What's weird is that it looks like the collision geometry has faces that can perfectly match the rendered geometry, it just doesn't. T$$anonymous$$s kind of accuracy is definitely unacceptable as characters clip into and float above slopes.


Edit

To be clear, t$$anonymous$$s is definitely not z-fighting in the physics debugger's display as I found t$$anonymous$$s by my character floating and clipping through terrain $$anonymous$$lls. It's hard to show in a screenshot, but if you zoom in you can see clear differences between the rendered gray faces and the collider's green faces. I've w$$anonymous$$pped up a very simple project to show t$$anonymous$$s and I'm surprised no one else is seeing t$$anonymous$$s as it's incredibly simple to reproduce. In t$$anonymous$$s project I just have a terrain with $$anonymous$$lls, a character controller with a simple movement/camera script, and a couple pins in the land that show obvious points of floating or clipping. You can also look at the areas of these pins with the physics debugger and see it is because of the difference between the terrain collider's faces and the rendered faces. I made t$$anonymous$$s from scratch in a few minutes using only built-in Unity assets and I'm using Unity 2019.3.0f3. It's also here.

terraintest.zip (25.6 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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by lgarczyn · Jan 12, 2020 at 01:40 AM

T$$anonymous$$s looks like z-fighting, w$$anonymous$$ch would just be a rendering issue. The height difference looks too small to affect your rigidbodies in a meaningful way. To get more help please provide a picture of a character clipping or floating, as well as the movement script.

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 Cains · Jan 12, 2020 at 09:44 PM 0
Share
avatar image
1

Answer by Bunny83 · Jan 12, 2020 at 02:13 AM

Unity uses PhysX for 3D physics.PhysX has different collider types and Unity's colliders pretty much map one to one to the physX types. The Terrain collider is not a mesh collider but a height field. The height field has some features we can not control with Unity, like the tesselation flags for example. Though like ceandros said I don't see any issue in your image beside the possible z-fighting. So it's not really clear what your question or concrete issue is.

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 Cains · Jan 12, 2020 at 09:51 PM 0
Share
avatar image wireframer Cains · Jan 20, 2020 at 06:52 PM 1
Share
issue.jpg (94.1 kB)
avatar image
0

Answer by ICE-jdeacutis · Jun 10, 2021 at 10:30 AM

Technically you may be able to solve t$$anonymous$$s using a custom terrain shader. If the size of the quads can be determined, the triangle vertices and UV's could be flipped. Not exactly trivial though.

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.

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

178 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

Related Questions

Terrain heightmap resolution affects collision calculation 0 Answers

Player's Rigidbody slides up terrain walls 1 Answer

Terrain and rigidbody not colliding - boat versus bank 1 Answer

Terrain collider failing in unity 5/17? 1 Answer

Character becomes detached from own collision capsule and sinks when moving over certain parts of terrain 1 Answer


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