• 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 dingben · Sep 13, 2010 at 05:20 PM · terrainterraindatainvisible-object

terrain unexpected collisions - loopidy loops

.

(I posted the answer below...)

PLEASE, someone provide thoughts on this issue.?

Everything built in the Unity designer, no external tools nor assets used.

I have a terrain that basically looks like the Sahara desert - dunes and a few tall cliff like structures - no detail, no trees, no grass... just a terrain, designed with the Unity tools. The terrain is 4000 by 4000.

I have several animations and static objects all primitives built in Unity. Each object is coupled with a GUI text to name it.

A path is noticeable amongst the dunes... where the vehicle travels. There are some vast areas of the terrain that are plain flat, at y=0.

Possibly boring, but the idea is to test not to design a final product at this time.

The objects counts is a factor in my evaluation. Thus there are a growing number of objects on the scene. There are nested animations. There are somewhat complex objects that have 2 to 3 levels of parent/child. ...but nothing EXCESSIVE aimed at breaking the house, just a nominal amount that are added in small increments in order to test speed differences and to evaluate load.

Each small scenario within the scene was tested to work and behave as expected before going to another.

The problem is that while the vehicle travels on basically naked terrain it encounters invisible obstacles that send it twirling sky-high in loopidyloops that more than often result in an infinite twirling of the entire scene - game over! ...must restart to recover.

It also can happen if the vehicle is parked with engine running, but not moving, or moving in an extremely slow drift pixel by pixel type speed(practically not moving).

It seems the vehicle falls thru the terrain when it goes into the infinite loops, but not always, it can twirl high in the sky and never come down. At times, I can drive repeatedly thru one area and get blown sky-high, resume movement each time after landing, and suddenly be able to pass thru the same area untouched.

I have spent a massive amount of time trying to resolve this problem. I have read that it occurs in the Designer only but not in the Game. That was a sigh of relief until I immediately tested it on my web Build and Run ?!! and chuhhhrashhh same problem!

Dirty go-arounds I am thinking about:

  • raise the vehicle 1 to 3 units over the terrain, but that will fail aesthetics in many positions in the scene.
  • add a button LOOPIDYLOOPS to recover the vehicle to a set position in the scene?!
  • dream that Unity 3.0 does not exhibit this problem, but I am not eligible for 3.0 based on current rules. COORECTION Oct 17, 2010: I am on 3.0 now and it does come free for all.

There is a painful way to attempt to troubleshoot the issue, but after seeing some of the posts here, I am a bit leery attempting it as I may get an answer here to save me the trouble. Although the mention I remember in one of the posts is that it only happens when ALT-TABBING between apps. If I get no answer I will have to test the terrain completely naked by exporting it to a new blank project with the vehicle only and then reintroduce all objects 1 at a time. (Please someone save me the pain.)

TERRAIN:

I see that when creating a terrain Unity creates a New Terrain.asset file on disk(project window). I nave searched in vain for information on this file.

I noticed that if there is no filename.asset file on disk, the Terrain(Script) in the Inspector prompts for one, but if it has one, then it is shown in the Collider in the Inspector. Removing the .asset file from the Collider does not seem to affect anything while the editor is running. Restarting Unity with None as terrain data seems to not affect the scene, as in this instance it finds the data it needs, and does not prompt as it does if nothing is on disk.

If in the Collider(Terrain Data) I set a filename.asset file that is not that of the terrain, then the terrain may not draw at all.

Could anyone provide or point to some information on the filename.asset file?

In the Inspector:

Terrain (Script) - Terrain Asset Missing, Assign: *None(Terrain Data)

Terrain Collider - Terrain Data: filename.asset

THINGS I TRIED: I suspected at first there were objects that were turned OFF(not enabled) that would cause the problem, or possibly some colliders that are automatically added to all new objects, so I cleaned up the scene and moved all disabled objects to x=-500, y=0, z=-500. I also removed all collider components from all children and most from the top parent of all objects. But my understanding is that disabled objects should not affect the scene at all.

That seemed to improve the situation but did not get rid of the problem.

VEHICLE:

The vehicle has a rigidbody and 3 colliders to cover its shape. It races thru the landscape quite nicely, up and down dunes, etc it stops cold onto a vertical of the terrain, it also will climb a near vertical terrain slope as long as the bottom of the incline is rounded. It falls off a cliff and lands on its wheels on the terrain and resumes as expected.

SCRIPTS:

The scripts used are the car demo script and the smoothfollow script provided in the Unity site, or any pointed to on the Unity sites. Again, even in scripting, nothing fancy just trying to stay within the recommended examples, not trying to do anything beyond with my own code.

The Main Camera is child of the vehicle. It is inside the vehicle within one of the colliders, where nothing can reach it, even if it lands upside down. I have seen that the smoothfollow script should be used for the Main Camera, but as the Camera is child of the vehicle container object, I see no reason that it would need the smoothfollow script, so I disabled it and it all runs well(either way).

I can post the code if needed, but it is readily available to all on the Unity pages.

Can anyone offer thoughts, I am at my wits end.

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 dingben · Sep 17, 2010 at 07:25 AM 0
Share

...not easy to search for info on this issue, but I may have unhearthed at least one: http://answers.unity3d.com/questions/2502/limiting-rigidbody-velocity

1 Reply

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

Answer by dingben · Sep 20, 2010 at 07:55 AM

I believe I found the problem.

I had 2 rigibodies on the same object, one in a child. I also had 2 exactly sized colliders that looked like one in the gizmo view... I removed the extra rigidbody and collider and everything got back to normal. I have predetermined locations where the vehicle can start the session. In each one of them the vehicle would initially land and immediately bounce off the tarmac sky-bound for a loopidy loop session... I moved the camera away from the vehicle to see better... and I turned the gizmos on in the Game window... low and behold, as the vehicle landed it extracted a green box(collider like) out of itself. The green box would stay attached and travel along side of the vehicle hitting the ground or other stuff, lol... after I removed the collider and the rigidbody... the vehicle lands as expected smoothly and comes to rest immediately and it no longer collides with invisible objects(terrain that is). Voila! ...oh the frustration, I had swept thru all objects and cleaned up everything but missed the only thing that caused the problem.

Note: ...here is something that I suspect is a source of problems while building a scene. Many a time while using the mouse inadvertent clicks will grab things in the various windows and copy/drop them in a new location... There is no confirmation trap(dialog) in the Editor to prevent that... I have had to move things back and at times it was hard to find out what actually had gotten misplaced and where. I know if there are too many confirmation dialogs it would be painful to move fast while editing but some of those should be trapped. oh well!

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

No one has followed this question yet.

Related Questions

heightmapWidth and heightmapHeight always equal 1 Answer

SetAlphaMaps Opacity Gradient 0 Answers

How do you make the material in the Terrain detail prototype properties update after runtime? 1 Answer

How to set Flatten HeightMap in Unity 4.2 1 Answer

SetPixel() on Terrain 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