hexagon logo

Adjust mass during simulation

Hello all,
 
I was wondering if it is possible to adjust the mass of a body during simulation?
 
Lets assume the body i want to adjust is named 'Ball'
 
I first tried the following:
  • Create another body and fix it to 'Ball'
  • Then by using a simulation script (Figure 1), it is possible to deativate the joint and thereby basicly reducing the mass of 'Ball'
 
This works (only for reducing the mass by the way), but i feel like it should be a lot easier with some sort of runtime function. However, i can't seem to get the correct syntax, see Figure 2.
 
Anyone can help me with the correct syntax (Figure 2), or knows another (better) way to achieve this?
 
Thanks in Advance,
 
Niels