// Distance Equation // this will make the rigid body solver activve when Effector is // within 3 grid units of the solver's center of mass (pivot point) float $dx = abs(Effector.translateX-rigidBody50.centerOfMassX); float $dy = abs(Effector.translateY-rigidBody50.centerOfMassY); float $dz = abs(Effector.translateZ-rigidBody50.centerOfMassZ); rigidBody50.distance = sqrt(($dx*$dx)+($dy*$dy)+($dz*$dz)); // Reset the rigid body on the first frame if(`currentTime -q` == `playbackOptions -q -min`) rigidBody50.active = 0; else { // Make the rigid body solver active when Effector is // close enough to the solver’s center of mass if (rigidBody50.distance <= rigidBody50.activeDist) { rigidBody50.active = 1; rigidBody50.ignore = 0; } // Factor this solver out when Effector is too far away if (rigidBody50.distance >= rigidBody50.maxDist) rigidBody50.ignore = 1; }