Hello,
I am currently working with 3D object for a game and there is a problemm with the objects that I have gotten. Its that there pivot point is of center,
which makes the objects behave very strangely when I use scripts to change there position. Is this problem coming from the pivot point and if that is the case, can I change the pivot point in unity?
Just remove the Rigidbody. I presume the Mesh is still rendering offset? If so, it’s your mesh and not physics. Would take 30 seconds to do this debugging.
Do you know you can just attached screenshots rather than pictures using a phone camera? It’s hard to see stuff in these.
Well, if the mesh is defined like that and you want the pivot to be in the center, the best solution is to edit the mesh in the modelling application where you created the mesh and fix the pivot there. If that’s not possible, you can always simply parent the gameobject to a new empty gameobject and fix the offset by moving the inner gameobject inside the new parent so the parent position is at the desired position relative to the mesh. Now simply use the new parent gameobject to position and rotate your object. If you need this object as a prefab, you can turn this new gameobject into a prefab by dragging it from the hierarchy to the project panel.
Note that the child mesh must not have a rigidbody attached. If you need / want to use a rigidbody, you have to attach it to the new parent gameobject since this now represents the object.
A third solution would be to fix the pivot offset of the mesh vertices in code. So you would essentially manipulate all the vertex positions at runtime. Though this doesn’t make much sense in most cases, as you would not see the correct result at edit time. Unity is not a modelling application. When you import models / meshes, make sure they are setup correctly before you export them from your modelling tool.