Best approach for instantly finding a suitable character pose using IK and collision.

I’m currently stumped by a problem and am not sure what the best approach is to solve it.

I have a character stood in a particular location in the world. I need to position their fingers on the surface of a table without the character’s hand intersecting with any of the objects on the table. This positioning of the hand needs to happen during a single frame (so the character is not animating but is instantly finding a suitable pose and taking it). I can test whether a given pose is suitable by using colliders on the character’s hand and on the table objects. The trouble I am having is that the hand position is dictated by Two Bone IK on each of the fingers. For a given hand position I need to run the IK system so that the finger joints are in the correct place, and **then **do the collision check. But I have multiple hand positions to check, one after the other, all within the same frame.

Is it possible to do this with UE4’s animation blueprints? I am envisioning a system where I alternate between setting the hand position in the animation blueprint and then testing for collision in the character’s blueprint until a suitable position is found.

If you have any insight as to how this could be achieved I would be very grateful for your input.