How does the CollisionRay Work?

well, I think I found something regarding the flipping problem.

on rdb’s last post, he was suggesting creating a directional vector from the subtraction of the previous pos to the current pos, but I thought there is always distance between the collision ray origin point and collision point due the collision sphere’s presence and radius.

So I subtracted the player’s position from the surface point and normalize that result, it ended up producing directional vector, and pretty darn accurate one too. I,m testing right now what I can do with this vector, and I will post a result soon!


EDIT: it has been some time, hah hah, but I did not get anywhere, I did make box and plane near each other, during my tests, and found that the plane works fine without my flipping technique but it flips the character with the technique applied, and vice versa with the box!

So if I,am thinking about it correctly my guess is the opposite face is also being detected, not only that, but the closer face/collision is being ignore and the farthest is only being applied since my code setup would pick up on the nearer face being closer, that is why everything is opposite detected on the ray.

It is giving priority to the last entry detected in the moment and ignoring the rest, the last entry on the box happens to be the bottom face which is opposite to the face that the character is on, so unless I misjudged something, this cannot be fixed. but I will wait for more opinions to see if a solution can be found, thanks for listening.