I’m trying to roll a dice (cube) using a rigid body and I would like to detect when the rolling stopped?
How can I detect that the dice is lying still?
Thanks
Detect when a rigid body stopped rotatingSoftware: Away3D 4.x |
||
sk, Newbie
Posted: 11 April 2013 01:23 PM Total Posts: 8 I’m trying to roll a dice (cube) using a rigid body and I would like to detect when the rolling stopped? How can I detect that the dice is lying still? Thanks |
||
John Brookes, Moderator
Posted: 13 April 2013 08:54 PM Total Posts: 732 [ # 1 ] if (!diceRb.isActive) This might take a sec from when it visibly stops to when it falls asleep. You can also check its linear and angular velocity. If its below some value its not gonna roll to the next face. |