Is there a way to draw center of mass on the screen?

Hi everyone,

I’m trying to see where the center of mass is located on my rigidbody, is there a way to draw it on the screen so I can then position it accordingly?

Thanks in advance!


using UnityEditor;
using UnityEngine;
public class RigidbodyEditor : Editor
	void OnSceneGUI()
		Rigidbody rb = target as Rigidbody;
		Handles.color =;
		Handles.SphereCap(1, rb.transform.TransformPoint(rb.centerOfMass), rb.rotation, 1f);
	public override void OnInspectorGUI()
	{ = EditorGUIUtility.GetBuiltinSkin(UnityEditor.EditorSkin.Inspector);