Trouble with Ladders

I’m making a game that has some ladders in it. I am trying to get the character to climb down from a ledge when they reach the edge, but when I attempt this, the character isn’t set to the correct location. I suspect that this has to do with the recentering functions that the character uses. The game is on a grid and I use timelines to move him subtly into alignment with the grid.

You can see in the video the function for climbing off the ladder works fine, but climbing from the top down onto a ladder does not.

This is the function for climbing down onto a ladder:

This is the function for climbing up over a ledge:

Hey @sweeetjd!

It looks like you need to add something adding 180 degrees in Z to make the character spin around before going down the ladder. Am I missing something in the code?

The rot is set elsewhere, then sent through RunnerTargetTransform Transform. The rot is going to be an issue at some point, but I can’t even get it to reliably set it’s location correctly. It just kind of flies around in circles at the moment and I’m not really sure why lol

Well then let’s look at where you’re generating that!

Don’t forget- you can right-click any struct pin to break it down. So if you need to alter that transform (say add 180 to the Z) you can break it, add that, create rot, and then create Transform and just put it all back together with your new values. :slight_smile:

Maybe try changing the 180 spin with another bit of code first, then use THAT current value as your “A” in your LERP, and the “RunnerTargetTransform” + 180ZRot as your “B”? Just don’t use positive AND negative values or it WILL spin haha.

I’m not sure what I did but it kind of works now lol. It did seem to have to do with the values you mentioned.

1 Like

Hey @sweeetjd! If you figured out what it was, make sure to mark the most appropriate post as the solution, or if you have time, it would be fantastic if you wrote up a reply on this post saying what worked for you and mark that! I know others will run into this issue and it will help them find their answers quicker, too! :slight_smile:

I’m not sure my solution is really “correct,” and I’ve decided to redo the movement system entirely, so I’m not sure it would help anyone, but I’ll take a look at my code and see if I can find something useful for others in there.

1 Like