try looking at this might give you an idea on how to make it work right, like putting collsion in it or something.
sync on : sync rate 0
set display mode 1280,1024,32
set text size 34
phy start
autocam off
make object box 1, 100,5,100
phy make rigid body static box 1
make object box 2,50,1,50
position object 2,0,6,0
phy make rigid body dynamic box 2
phy set rigid body mass 2,100
`phy set rigid body kinematic 1,1
make object cube 3,20
position object 3, 0,90,0
phy make rigid body dynamic box 3
phy set rigid body mass 3,1000
position camera 0,20,-120
oldweighta=phy get rigid body mass (2)
oldweightb=phy get rigid body mass (3)
do
text 0,0,"old weight A="+str$(oldweighta)
text 0,40,"old weight B="+str$(oldweightb)
text 0,60,"weight A after start platfrom "+str$(phy get rigid body mass (2))
text 0,80,"weight B after start box "+ str$(phy get rigid body mass (3))
wa#=phy get rigid body mass (2)
wb#=phy get rigid body mass (3)
phy update rigid body mass 2,0.0,wa#+wb#
phy update
sync
loop
and with collsion
sync on : sync rate 0
set display mode 1280,1024,32
set text size 34
phy start
autocam off
make object box 1, 100,5,100
phy make rigid body static box 1
make object box 2,50,1,50
position object 2,0,6,0
phy make rigid body dynamic box 2
phy set rigid body mass 2,100
`phy set rigid body kinematic 1,1
make object cube 3,20
position object 3, 0,90,0
phy make rigid body dynamic box 3
phy set rigid body mass 3,1000
position camera 0,20,-120
oldweighta=phy get rigid body mass (2)
oldweightb=phy get rigid body mass (3)
do
text 0,0,"old weight A="+str$(oldweighta)
text 0,40,"old weight B="+str$(oldweightb)
text 0,60,"weight A after start platfrom "+str$(phy get rigid body mass (2))
text 0,80,"weight B after start box "+ str$(phy get rigid body mass (3))
`wa#=phy get rigid body mass (2)
`wb#=phy get rigid body mass (3)
while phy get collision data ( )
a = phy get collision object a ( )
b = phy get collision object b ( )
if a=2 and b=3
phy update rigid body mass 2,0.0,oldweighta+oldweightb
else
phy update rigid body mass 2,0.0,oldweighta
phy update rigid body mass 3,0.0,oldweightb
endif
text 0,60,"weight A after start platfrom "+str$(phy get rigid body mass (2))
text 0,80,"weight B after start box "+ str$(phy get rigid body mass (3))
endwhile
phy update
sync
this is with trigger but I think I have it wrong.
sync on : sync rate 0
set display mode 1280,1024,32
set text size 34
phy start
autocam off
make object box 1, 100,5,100
phy make rigid body static box 1
make object box 2,50,1,50
position object 2,0,6,0
phy make rigid body dynamic box 2
phy set rigid body mass 2,100
`phy set rigid body kinematic 1,1
make object cube 3,20
position object 3, 0,90,0
phy make rigid body dynamic box 3
phy set rigid body mass 3,1000
position camera 0,20,-120
oldweighta=phy get rigid body mass (2)
oldweightb=phy get rigid body mass (3)
do
text 0,0,"old weight A="+str$(oldweighta)
text 0,40,"old weight B="+str$(oldweightb)
text 0,60,"weight A after start platfrom "+str$(phy get rigid body mass (2))
text 0,80,"weight B after start box "+ str$(phy get rigid body mass (3))
`wa#=phy get rigid body mass (2)
`wb#=phy get rigid body mass (3)
while phy get collision data ( )
a = phy get collision object a ( )
b = phy get collision object b ( )
if a=2 and b=3
phy update rigid body mass 2,0.0,oldweighta+oldweightb
else
phy set trigger callback 1
if phy get trigger action ( )=1
ta = phy get trigger object a ( )
tb = phy get trigger object b ( )
if ta=2 and tb=3
phy update rigid body mass 2,0.0,oldweighta
phy update rigid body mass 3,0.0,oldweightb
endif
endif
endif
text 0,60,"weight A after start platfrom "+str$(phy get rigid body mass (2))
text 0,80,"weight B after start box "+ str$(phy get rigid body mass (3))
endwhile
phy update
sync
loop
Dark Physics makes any hot drink go cold.