I have a 3d model prefab in unity that I'm trying to add physics to. The issue is that the prefab was imported from auto desk and when that happened the pivot/center of gravity for all the child mesh objects was not where you would necessarily expect them. I've tried attaching a rigid body to the various child objects and setting the center of mass with a script but it doesn't seem to be working as I would expect. My method for setting the center of mass involved creating two child game objects at either end of the highlighted object and using the midpoint formula to a 'good enough' center of mass. Is there any way around this beyond rebuilding/re-importing the object?
Showing the off center pivot
Showing the weird center of mass
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CenterOfGravity : MonoBehaviour
{
// Start is called before the first frame update
public Transform[] centerPoints;
public Rigidbody rb;
void Start()
{
centerPoints = gameObject.GetComponentsInChildren<Transform>();
Transform center1 = Array.Find(centerPoints, elem => elem.name.Equals("Center1"));
Transform center2 = Array.Find(centerPoints, elem => elem.name.Equals("Center2"));
Vector3 center = (center1.localPosition + center2.localPosition)/2.0f;
rb = GetComponent<Rigidbody>();
rb.ResetCenterOfMass();
rb.centerOfMass = center;
}
// Update is called once per frame
void Update(){}
}

