How can I go about relocating the center point of a blender model directly imported so I can move the pivot point?
I have actually created a script for this a while ago. Put this in your Editor folder and it will be under the Custom tab.
using UnityEngine;
using UnityEditor;
using System.Collections;
public class ChangePivot : ScriptableWizard {
public float offset_x = 0;
public float offset_y = 0;
public float offset_z = 0;
public bool shared_mesh = false;
public GameObject obj;
[MenuItem ("Custom/Move Pivot Point")]
static void CreateWindow()
{
ScriptableWizard.DisplayWizard("Move Pivot Point of Object",typeof(ChangePivot),"Move Pivot");
}
void OnWizardUpdate()
{
}
void OnWizardCreate()
{
change ();
}
void change()
{
Mesh mesh;
if(!shared_mesh)
{
mesh = obj.GetComponent<MeshFilter>().mesh;
}
else
{
mesh = obj.GetComponent<MeshFilter>().sharedMesh;
}
Vector3[] temp = mesh.vertices;
for(int i = 0; i < temp.Length; i++) //Loop through and move the object's mesh
{
temp <em>= new Vector3(temp<em>.x + offset_x, temp<em>.y + offset_y, temp*.z + offset_z);*</em></em></em>
* }*
* mesh.vertices = temp;*
* obj.GetComponent().mesh = mesh; //Just gotta make sure we make get the mesh back to the object.*
* }*
}