Hi, I am making a 2d game where the player can place each ladderblock individually. I am using the OnComponentBeginOverlap and the OnComponentEndOverlap to figure out if the ladder is in the player’s range, so the player can climb it, and that works, but when I am leaving one ladderblock, my character stops flying. This is because “climb” is set to false when I am leaving the first block. Are there any ways to fix this?
I have had this problem before as well. What I did was not the best solution but it works. On overlap, cast to player and set a actor variable to self, to show the ladder your inside off, instead of using a bool, do a isValid check to see if your in a ladder. OnComponentEnd, cast to the pawn, and do is Ladder == self, if true, set as null. Basically as you overlap new boxes it changes it so it wont be setting it to false. A better alternative i thought of but never tried, you could make it a ladder actor array. Add to it when you overlap, and remove self when you end overlap. To see if your on a ladder, just see if the array is length > 0. If you use both begin and end overlap to call a custom event, ie CheckLadderStatus, you can do it without using tick.