As in the title.
When my player object climbs a ledge, it moves in the following fashion:
transform.position = new Vector2(transform.position.x + (bCollider.size.x * transform.localScale.x), transform.position.y + bCollider.size.y);
bCollider is the player’s 2D box collider.
I have a child object that moves in advance.
The child’s default position is 0, 0, 0 (relative to the parent), and it fetches the player’s collider size the same way the player is using it.
It moves like:
transform.position = new Vector2(transform.position.x + (playerCollider.size.x * transform.localScale.x), transform.position.y + playerCollider.size.y);
But for some reason, the child doesn’t move the full distance. It doesn’t appear to be far off. I’m not sure of a good way to measure how far away it is from the intended height, but it looks to be about the height of the child away from the target.