- Home /
How to use Automass?
Hi everyone,
I'm sure that I'm missing something very simple, but I can't get auto mass to work in my 2D game. I know that auto mass is density times area of the collider. This is what I have. I always get that mass value of 1. How do I find my auto mass value?
Have you tried changing the value for Density yet...? I just made a new scene with the same set up, and changing the density also changed the mass. I$$anonymous$$O, unless you got some real complex stuff going on like random generation, just use regular mass.
Answer by MelvMay · Feb 05, 2017 at 10:31 AM
A Collider2D set to be a trigger does not affect the center-of-mass or rotational inertia and as such doesn't affect the calculated mass. This has always been the case for both 2D and 3D.
From your image, the only collider you have is to set be a trigger therefore it's not part of any auto-mass calculation so the mass defaults to 1 (the same as if no collider were added). You'll also notice in the Rigidbody2D 'Info' roll-out that the center-of-mass and rotational inertia are at defaults.
Try temporarily turning off the IsTrigger and you should then see that the Collider2D.density property appears and that the Rigidbody2D.mass is calculated accordingly.
Your answer
Follow this Question
Related Questions
How to instantly accelerate a falling game object to the maximum fall speed? 2 Answers
Rigidbody2D.position and Rigidbody2D.MovePosition() 0 Answers
Kinematic vs. non-kinematic movement over a curve 0 Answers
Rigidbody2D constraints checked for x and y but still moves when character jumps on it from distance 0 Answers
How to fix bouncing, jittery effect between two dynamic objects in 2D 1 Answer