Greetings
I am working on a 2D game ledge climb mechanism using ray cast. When my cast hits the ledge my animation along with this code is called GetComponent<Transform>().position = new Vector3(climbPos.x + 1, climbPos.y + 1, -36.1f);
Now basically this code adds 1 to the X and Y and pushes the character UP and Right to stand on the ledge granted the ledge is to the right ->.
However…if the ledge is on the left, seeing as it adds 1 my to the X axis my character is pushed further away instead of 1 being subtracted from X.
What logic can I employ to get this working correctly, I tried to use transform.position as to get the direction I was facing but was not sure how that would have to be implemented.