I'm having a hard time setting up a driver to rotate my object based on the proximity of another object. I'd like to have multiple faces of an object rotate 180 degrees based on the proximity of a driver object. I have so far managed to get a simple 180 degree rotation working by using the expression:
max(0,min(pi,5-abs(distance)))
with the distance variable being the distance between my driven object and my driver object
It's a problem however because once my driver goes over the driven object and the distance starts to grow again, it rotates back to the driven objects original rotation. I'd like for this rotation of 180 degrees to stay as I would like to do a procedural animation of walls changing colour without having to rotate each plane individually. I'm using drivers as I need to be able to bake the animation to keyframes so I can export the objects with the animation.
I hope I gave enough context :)