When Rick challenged us to build the ladder and climbing mechanic I understood that much of what we’d done so far could be reused to make it work.
I was so proud that I spotted which parts I should copy/paste and set up the script in the same order as Rick. But when I tried it, my character just flew away as if he was climbing right from when I pressed Play.
After a lot of experimenting, I ended up deleting everything and went on to follow him and then it worked without any issues. Since I can’t figure out what I did wrong, if anyone else had these issues or recognize it, what could I have done wrong?
I even wrote this statement by myself, which feels like what should have been the issue:
if (!myBoxCollider.IsTouchingLayers(LayerMask.GetMask(“Climbing”)))
{
return;
}
The only things I know I didn’t follow were:
- Using a BoxCollider2D instead of a CompositeCollider2D for the Climbing tilemap
- Forgot to add a TilemapCollider2D
- Didn’t adjust the ladder’s custom physics shape