- Home /
Problem with changing rigidbody.mass value in script
I am trying to change mass of a 3D object programmatically. But the object doesn't get the calculated mass but a 0 value initially. When the prefab of the object is created it gets the calculated mass of the previous object not the current mass. And the scenario repeats for all the prefabs created henceforth. How can I get around this problem? Any help is greatly appreciated.
Comment
Do you mean, how do you do that? Because you have not described a single problem, just an algorithm. Could you be more clear?
I suspect a code logic error...setting the mass of the Rigidbody before doing the Instantiate(). Posting code would be helpful when asking this kind of question.