I have two particleSystems, s1 has an animated transformNode, the second one (explodeMe) should follow the first one via a runtime expression. I also want to check the distance beween them (there shouldnt be one). I made a custom attributePP (distance) for checking purposes.
// transfer worldPosition of s1 to position of explodeMe
$pos = explodeMeShape.worldPosition; $sPos = s1.worldPosition;
explodeMeShape.position = << $sPos.x, $sPos.y, $sPos.z >>;
// get the distance
explodeMeShape.distX = $sPos.x - $pos.x; explodeMeShape.distY = $sPos.y - $pos.y;
explodeMeShape.distZ = $sPos.z - $pos.z;
$dist = << explodeMeShape.distX, explodeMeShape.distY, explodeMeShape.distZ >>;
explodeMeShape.distance = mag($dist);
When I scrub frame per frame, the distance is never 0. But when I do a refresh on the same frame, the distance changes to 0, as it should! Seemes that the attributes are somehow dirty and dont update correctly.
Has anyone an idea how I could get an immediate refresh of the distance?