So ive tried severel of methods, non works. Here is my code:
GameObject temp_obj = GameObject.Instantiate(building, new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
// Add components
Rigidbody r = new Rigidbody();
r.inertiaTensor = new Vector3(1, 1, 1);
r.useGravity = false;
temp_obj.AddComponent(r);
And:
temp_obj.AddComponent<r>();
However i cant seem to add the local created RigedBody, can someone help me?