Thursday, 28 February 2013

Physics Issues

Car Physics:
The car physics did not go as planned. The car would flip over and rest upon its side if the car was to suddenly turn at high speeds. Now obviously this is no good as in a car game you would expect the car to travel at high speeds and have to navigate around many corners. Below is a video which shows you the issue I encountered.

As you can see from the video above the car goes spiraling out of control. It took a while to solve this problem before finding out the reason which is down to the rotation settings on the model.

The rotation settings on the car are not all set to a default value of zero which means the car isn't properly upright as it appears to be in the video. 

In fact, due to the rotation on the Z axis, the car is technically on its side which means because we added a rigid body. The rigid body applies gravity to the car meaning it only takes the smallest push before gravity played its part and flipped the car back to its side (zero on the x axis).

Too fix this issue I have to go back into Blender3D and change all the values back to zero. However a problem with the Blender to Unity exportation is that it changes the X rotation value to -90 on import.

This means in order to set it to zero I need to set the X rotation to -90 and then apply the rotation and then change it to zero again. This would solve the issue however as I created my model incorrectly on the Z rotation axis meaning the values I changed earlier get reset again meaning I can't change two axes this way without messing up the shape of my model.

The reason it would mess it up is because I created it in separate parts instead of two (mesh and wheels). If I want to use this mesh I would need to recreate in Blender3D making sure all the rotations are at zero first however given the time and effort it took to create it would take too long and have chosen to use a free-to-use model instead.


No comments:

Post a Comment