Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 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
8
Question by bugra271 · Mar 04, 2015 at 02:14 PM · colliderterrainunity5

Terrain Collider Bug in Unity 5

Hi,

Terrain collider is not working right. Take a look at this;

alt text

Car will go through hill. Hill's collider is at wrong place on terrain;

alt text

Car is at top of the hill collider at this image. So anyone got this issue?

untitled.png (380.9 kB)
untitled.png (279.9 kB)
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 MichaelJT · Apr 07, 2015 at 06:09 PM 0
Share

Was having this problem too. Any changes to the mesh didn't update the terrain collider until either:

a) the scene was saved b) Unity was restarted c) I created a build of the project

avatar image dk_arian · Apr 06, 2017 at 03:35 PM 0
Share

i dnt think so after we change the width and length of terrain after creat mountain the terrain mountain colider is not working coz terrain colider is move out when we are change the setting of width and lenth of terrain .... we should in start terrain modifie the width and length then creat mountain ...

6 Replies

· Add your reply
  • Sort: 
avatar image
12
Best Answer

Answer by FuryOfFlames · Mar 04, 2015 at 04:56 PM

Been having the same problem. Looks like the engine has trouble making mesh colliders for terrain after you change geometry. Probably has to be patched out.

Update: Seems to get fixed after you save your scene.

Comment
Add comment · Show 10 · 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 kevingt · Mar 05, 2015 at 02:44 AM 0
Share

Thanks for the update/workaround. I thought I was loosing my $$anonymous$$d.

avatar image iamth3walrus · Mar 05, 2015 at 11:59 AM 0
Share

Joined the forum just to say thank you

so....thank you

avatar image Dealzu-The-Wikid · Mar 11, 2015 at 12:53 PM 0
Share

Thanks! I had the same problem with my character movement script after editing the terrain to create a path through a mountain area. Completely fixed after saving, appreciate the advice.

avatar image MaadMann · Mar 11, 2015 at 07:32 PM 0
Share

my character pass under the terrain and after save the scene it's work weel, thank you :D

avatar image STApps · Mar 12, 2015 at 02:50 PM 1
Share

Just experienced this problem, the collider seems to have some kind of offset. Saving the scene and restarting Unity didn't help. Do you guys have any info on this? (I'm generating the terrain at runtime)

Show more comments
avatar image
2

Answer by LesterZw · Apr 07, 2015 at 06:26 PM

If your modifying terrain in playmode try this workaround,

 float[,] terrainHeights=terrain.terrainData.GetHeights (0,0,terrain.terrainData.heightmapWidth, terrain.terrainData.heightmapHeight);
 terrain.terrainData.SetHeights (0,0, terrainHeights);

Make sure this executes after the code that makes the modifications to the terrain.

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 wopper999 · Apr 10, 2015 at 03:43 AM 0
Share

yes, and depending if you already have the float terrainHeights (or whatever you have called it) already at the top of the script then all you have to do is enter the code after the "=" additionally if you made a change for terrain that changes the name at the top of your script you will need to change the terrain part of each of the terrain.terrainData to what you have made. for example in $$anonymous$$e at the top i have public Terrain myTerrain (this allows me to drag my terrain in the inspector so if i change the terrains name it will still work) so where it is terrain.terrainData $$anonymous$$e now says myTerrain.terrainData

avatar image Darkgaze · Mar 26, 2019 at 07:55 AM 0
Share

Setting the heights in the terrainData doesn't update e terrain collider. Still in 2017.4

avatar image
0

Answer by bugra271 · Mar 05, 2015 at 03:23 AM

Restarting Unity may fix the problem sometimes.

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 Stephanides · Mar 12, 2015 at 02:54 PM 0
Share

For example im making terrain in playmode and i take terraindata from existing terrain, i cant restart unity or save scene or something because in my playmode i can modify terrain. I have also this problem.

avatar image
0

Answer by Stephanides · Mar 24, 2015 at 10:11 AM

Fix this somebody who edit terrain in playmode ?

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

Answer by Jubtog · Aug 11, 2015 at 04:24 PM

For anyone not editing in play mode and still having Terrain Collider issues that aren't fixed with a save...

I don't know if it's a good solution, but I fixed this by baking a nav mesh into all my scenes. I then added a nav mesh agents to the player as well as all my enemy characters. It works better than nothing, but you have to re-bake if you change anything static in the scene, and baking can take a long time.

If there is a better fix in another thread please post a link in this thread.

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
  • 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.

Follow this Question

Answers Answers and Comments

33 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

Related Questions

Terrain Tag OnControllerColliderHit not showing 0 Answers

first person controller help 1 Answer

How to create a ground/terrain/floor that won't respond to gravity or objects falling on it? 1 Answer

How can a character not move out of box collider's bounds? 1 Answer

Solution for the FPS Character Controller falling through terrain 2018.3 Version 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