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