Hi there,
I am currently having something I know the reason, but can not easily find the solution.
I post the code:
//vector from player to hitPoint
Vector3 playerToHitpoint = (player.transform.position- hit.point);
//calculate distance
float currentDistance = playerToHitpoint.magnitude;
//keep the player at the desired distance
player.transform.Translate((currentDistance - sneakWallDistance) * playerToHitpoint);
My problem is, that the object can only rotate half the way around a given collider. I think it has to do with playerToHit-Vector beeing positive/negative.
Any help greatly appreciated!