
After working my way through the tutorial at http://www.gotow.net/andrew/blog/?page_id=78 with my dune buggy model, I needed to import some assets into my project from the website (such as sound and the wheel slip prefab). After I was done with the tutorial, I added a plane below my dune buggy gameobject and previewed the scene. The first thing I noticed was that the camera was looking at my car side on, but the car was successfully driving around on the plane (albeit I couldn't see where I was going).
I had a quick look on the tutorial website to see if anyone had mentioned the problemed but no luck. To fix this problem, I dabbled into the camera 'smooth follow' script myself. A method I found that worked was switching the x and z co-ordinates at every instance in the code. After once again compiling the scene and running the game, I found this did the trick. However, after viewing it from the correct perspective, I noticed a few other glaring mistakes.
Once thing is that the dune buggy had steering problems and would fly into the air if travelling too fast, or reversing. The other more major problem is that the wheels would spin around the wrong axis (creating a most perculiar looking effect). Using a similar method to the camera, I decided to edit the script and flip the x and z co-ordinates around. Sure enough, this did the trick and the wheels worked fine.
Thinking about it some more, it seems that perhaps the x and z co-ordinates of my blender model were the wrong way around, and so unity believes that the front of my dune buggy is infact the side of it. As long as the car runs fine, then this shouldn't be too much of a concern.
No comments:
Post a Comment