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 crazy_boy_02 · Apr 29, 2013 at 04:41 AM · colliderterrainterraincolliderunity4.0

unity 4.0 terrain collider issue

HI All,

I just ported my game form unity 3.5.7 to unity 4.1.2, but i am observing some weird behaviours in the game after porting.

The issue which is concerning me the most is terrain colliders, they doesn't seem to work. The players always go through the terrain .

I have tried a lot of things already like

  1. removing the terrain collider and then reapplying it : No Sucess

  2. Checked isTrigger property on all the terrains : It's unchecked

  3. Put a new terrain above the current one : It's working with the newly created terrain but i want to use my old terrain as i have already done lot of work on it already.

  4. Try using other object like a cube : it worked but still i want to use my old terrain

so after trying all the points listed above, its certain that it is not a problem with character(as it is working absolutely fine with other objects)there is surely something wrong with the terrain colliders.

Can anyone please help me out with this, thanks in advance

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 AlucardJay · Apr 29, 2013 at 04:46 PM 0
Share

All I can suggest is make some custom editor tools to read the terrain data of the old terrain, then apply it to the new 4.x terrain.

Basically I'm saying read the terrain data on the old terrain, then apply that data to the new terrain, then delete the old terrain.

This of course will only work if the 4.x terrain works with the same height/splat/detail information as 3.x . But if it does work, then all heights, textures, trees and grass will be the same as the original terrain.

I don't have 4.x, but if you are stuck or don't know how to read the terrain data then i shall write you a script to test my theory.

Good question, upvoted in the hope that someone with experience with 4.x will see this and help.

avatar image crazy_boy_02 · Apr 30, 2013 at 03:13 AM 0
Share

it would be great if you could provide me a script for this ...

1 Reply

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

Answer by AlucardJay · Apr 30, 2013 at 04:47 AM

I don't have Unity 4.x to test this, but this is tested and working in 3.5 . Create a new scene. Create an empty gameObject, add this script to it. Then drag your old terrain and new terrain into the scene, and from the scene drag them into their inspector slots. Then Right click on the inspector where it says ScriptName (script). There is a drop down that normally says :

 Reset
 Remove Component
 Edit Script

now there should be another one

 Read Terrain Data

click on that. The new terrain should now be the same as the old terrain. All the textures, trees and detail should be added to the new terrain also.

WARNING this edits the terrain and cannot be undone.

BACKUP your terrain , right-click your terrain and then select Export.

 #pragma strict
 
 var oldTerrain : Terrain;
 var newTerrain : Terrain;
 
 private var oldTerrainData : TerrainData;
 
 #if UNITY_EDITOR
 
 @ContextMenu( "Read Terrain Data" )
 
 function ReadTerrainData() 
 {
     if ( !oldTerrain || !newTerrain )
     {
         Debug.Log( "No Terrain in the Inspector" );
     }
     else
     {
         oldTerrainData = oldTerrain.terrainData;
         
         newTerrain.terrainData = oldTerrainData;
     }
 }
 
 #endif
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 AlucardJay · Apr 30, 2013 at 04:48 AM 0
Share

If it doesn't work in Unity 4.x, I'll delete the answer. Hope it does.

avatar image crazy_boy_02 · Apr 30, 2013 at 04:50 AM 0
Share

thanks a lot mate, i will update you on the progress...

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

13 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

Related Questions

Sphere Collider with Terrain 0 Answers

Capsule collider going through terrain collider 1 Answer

Player falling through Terrain collider 0 Answers

Terrain rotating on collision,Terrain rotates on collision 0 Answers

Terrain Generation ruins collision 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