So, I have a prefab with a Rigidbody and a C# script attached. The prefab has a cube child object with a collider on it. The prefab is instantiated at runtime when the user clicks and the user can change the scale of the object. I call SetDensity on the Rigidbody whenever the volume gets changed in this way but the mass value in the inspector doesn't seem to change from it's initial value that was set in the prefab. If I print out the value of rigidbody.mass just after I call SetDensity it all looks fine - the value is different as it should be but it just doesn't change in the inspector.
It doesn't actually matter as long as the physics engine is recognising that the mass has changed but it does seem weird.. anyone else run into this?
Thanks :D
↧