Rigidbody.worldCenterOfMass Manual     Reference     Scripting  
Scripting > Runtime Classes > Rigidbody
Rigidbody.worldCenterOfMass

var worldCenterOfMass : Vector3

Description

The center of mass of the rigidbody in world space (Read Only).

JavaScripts
Debug.Log(rigidbody.worldCenterOfMass);

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
Debug.Log(rigidbody.worldCenterOfMass);
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
Debug.Log(rigidbody.worldCenterOfMass)