A brief description is that:
I want to the set the character to ledge hang, but I want his hands to be touching the ledge. So I just need to copy the y and z of the ledge, where y is how close the character to the ledge, and z where on the Z the character is hanging.
But when I set the position to the y and the z of an empty, it also sets the X so it always centers the character where the empty is on the ledge…
It is always a little bit hard for me to find a fault without debugging the code. But I think the fault is that you subtract of the world coordinate position of the Empty from the world coordinate position of the player. So try to use lx = test [0] for the ledge on the x axis and lx = test [1] for the ledge on the y axis.
This is script is a littel bit different from that in the video. I look at it, but I can’t find the fault. Do you have an exampe blend file (with the actual script) that you can post. So I can try to fix the problem.
What I did was, once I set the orientation to the empty for the ledge hang, I got the distance between the hit position of the ray and the bounding box, I moved it all the way, and then I subtracted some of the distance so it would look like he’s hanging on to the edge. Now everything works perfectly.