Skip to content

Instantly share code, notes, and snippets.

View rslnautic's full-sized avatar

Ramón Serrano López rslnautic

View GitHub Profile
@rslnautic
rslnautic / RigidbodyMassCalculator.cs
Created January 16, 2016 13:53 — forked from FreyaHolmer/RigidbodyMassCalculator.cs
Used to approximate a proper mass value for all the colliders in a given Rigidbody
using UnityEngine;
using System.Linq;
[RequireComponent(typeof(Rigidbody))]
public class RigidbodyMassCalculator : MonoBehaviour {
public float density = 1f;
public bool recalculateOnAwake = true;
Rigidbody rb;