After my attempt over at the Wingnut Chronicles, I was wondering if the was any way to set the mass of a physics impostor after it has been made. Like push “s” set mass to 1. push “j” set to 0. something like that, except just the change part.
If you create an impostor with mass 0 it becomes kinematic so that might be the issue. Try creating it with mass 1 and then set its mass to 0. Then see if changing the mass works. Share a playground if you still have issues.
because that is what I thought the docs were telling me what to do. I now have it working, as it is actuallyobject.physicsImpostor.setmass = 1;. I got it figured out now. @trevordev thanks for the explanation it works great.
I you click on the “find examples in playground” link on the doc page the syntax for examples use parenthesis and not the equals sign.
Hello!
Thanks you all to solve the problem about how to change the mass of a physics impostor. Unfortunately, I met a new problem. I create a button, which as I click it then the mass of a physics impostor will increase 1 kg. However, when the mass reached 3 kg, I click the button again, the physics impostor begin to move, just like apply a force on it. I don’t know which step is wrong?