Skip to content

Instantly share code, notes, and snippets.

View Awkwardnaut's full-sized avatar

Awkwardnaut

View GitHub Profile
@Awkwardnaut
Awkwardnaut / gist:8a8dafd6e8b01ee222c765deed6c1f14
Created June 20, 2020 13:33
C# Unity set the center of mass of your rigidbodies
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public class CenterOfMass : MonoBehaviour
{
public Vector3 _localCenterOfMass;
private void Awake()
{
SetCenterOfMass();