A Healthy Solution to Pivot Problem - Unity 3D

I will today share a solution that i found more convenient and functional about Pivot ! So lets do it. 

When we talk about 3D model ! Every character or an object have a pivot point.  That is very important that pivot should be in the center of that object. If it's not in the center we have to face many problem regarding this.

Keeping the model aside. If you have imported a model in unity you have to work with it independent of the graphics and designs. If your logic is dependent on models then you have to face many problems.  Lets come across with a common problem that we face in unity is pivot problem.
Models that we import sometimes have pivot disturbed position. And it's difficult to work with!

Now if we have to rotate an object  it will rotate around the pivot. The object will change not only its current axis but also position. Now that frustrating why the object changes it's position. It's satisfactory if there is nothing to do in the game scene ! because we can transform position manually in the scene. But if the object have to rotate it will rotate and will rotate around a large angle.

Now if you are an expert with 3D designer software you can change the pivot to 0,0,0. That also solve the pivot issue ! But what if we have to do the same without designer software ?When it comes to 3dmax or maya you can do it giving the object 0,0,0 axis in other words resetting the pivot points.

Lets see how we can do it in Unity 3D.



Now here is a tyre in the picture that have pivot away from it. Now if we give 180 degree rotation in the y axis of the rotation is will rotate around large axis changing it's position.Now that's hectic. When we have to rotate car's wheel. But the solution is easy.

First of all create an empty object. Then  Component --> add Physics --> Wheel collider in in the empty game object. And set the wheel collider according to the size of the wheel. Here the picture shows how its done.


Now take the wheel and make it the child object of the game object that have wheel collider in it.
This solution works fine. Try anything with it. It will surely pass your test.  I hope you don't have to wander around being frustrate about the problem.

Comments

Popular posts from this blog

How to move an object in Unity 3D

Input.Getaxis, OnMouseDown, GetComponent< > - Unity Scripts

Vector Math - Unity