Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetDensity(float)

Sets the mass based on the attached colliders assuming a constant density.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public void SetDensity(float density)

Parameters

density

Remarks

This is useful to set the mass to a value which scales with the size of the colliders.