Using Ladder climb with Swimming Ability

kuzeykirklar

New member
Hi, I am using the ladder climbing and swimming abilities. I want to use the ladder climbing ability while in the water. It moves towards the ladder but gets stuck there. The swim ability remains Active and the Ladder never becomes active. What would be the best approach for this situation?
 
Do you have the climb ability as a higher priority compared to the swim ability? If you look in the Animator what state ID is active? Is it for swimming or climbing?
 
Index 301 is the swim ability so the climb ability isn't starting. Does Climb.CanStartAbility get called?
 
Ok, so you may need to subclass Climb.CanStartAbility with the ladder ability. The ability assumes that you are starting from the ground so by not having that you'll need to modify the script in order to start the ability.
 
I did something similar but the real problem seems to be caused by move towards. When I pressed the button in the exact right position in the script I changed, it disabled swimming and switched to ladder climbing. Even though the animations worked correctly, the player did not move.
 
override ShouldStopAbility(...)if(ability is climb)return true; roughly?
I can't write the script inside the swim ability because is climb is never active. Instead, I wrote a script inside the climb script that says if it is swimming, return true and end the swim ability.
 
I will need to take a look at this use case. I have it written down on my list and would like to include an example in the next add-on update.
 
Hi again. When do you think you can look at it? I have deactivated the game's demo on Steam until this problem is solved. If it takes too much time, I will continue to look for a solution.
 
Hello @kuzeykirklar , I took some time to experiment on this tonight and got some first results ! Allow me to show you this :


This is by no means perfect nor on the same quality level as what you would see in a bug budget game, but it proves that there is a way to make the Ladder Climb and Swim ability work hand in hand.

The key points I can highlight are :
-The ladder needs to be deep enough in the water for Ladder.CanMount to return success.
-Move Towards is above Ladder Climb which is above Swim.
-I added a bool parameter called m_IgnoreGroundCheck to LadderClimb and used it at the beginning of CanStartAbility in the first if statement, like this :

C#:
 if (m_CharacterLocomotion.Grounded || m_IgnoreGroundCheck) {

Allow me to offer you a free 30m screenshare to take a look at your character and ladder together - this is a relatively complicated and niche situation, and your scene and character may need some specific considerations. You can reach out to me in DM here or on discord ("cheo") if you're interested :)
 
Thank you very much for your feedback. Actually, we did exactly the same thing, I had only two mistakes. First, I was manually stopping the swim ability. Second, I forgot to check the Ladder.CanMount to return success condition, which caused a bug. Believe me, I don't know the reason. Eventually, I fixed these and it worked great in my own project. If you hadn't posted, I wasn't planning on checking until Justin got back to me. Thank you very much.
But it still has to swim to the airborne position. It doesn't affect me since the game is FPS but Justin will have to figure that out:LOL:.
 
Hi guys, At first it seemed ok but as we tested it we noticed that it works inconsistently. The problem is that this ladder is connected to a rigid body ship that is constantly moving due to the waves. These movements sometimes cause moveTowardsLocation to be buggy and the camera to go into an infinite rotation movement and the MoveTowardsLocation ability remains active forever. But sometimes it just works fine.
 
Hey, here's a suggestion, the Move Towards ability has a Teleport On Early Stop bool set to true by default that can teleport your character if a specific amount of time has elapsed. Even if you're not actually using Move Towards to swim to the ladder the same logic can be used by manually using UltimateCharacterLocomotion.SetPositionAndRotation to teleport your character after a given amount of time. This is a trick used in famous games to make sure a character can reach a target even if complicated circumstances don't really allow for it - last year I replayed Batman Arkham City and the game does that in niche situations when using the grapnel or performing a takedown in cluttered spaces.

You can also do the opposite and stop the character's automatic movement if he fails to reach the target after a specific amount of time.
 
@kuzeykirklar Hey, I watched your video, the boat barely moves so that makes the issue even stranger. Here are the two issues I have so far :
-Are you perfectly able to climb ladders that are static and not attached to a boat ?
-Have you tried stripping this character down of any irrelevant component and ability ?

That's all I can suggest for now. The offer for a screenshare still stands, it would be simpler for the both of us if I could take a look at this directly.
 
-Are you perfectly able to climb ladders that are static and not attached to a boat ?
Yes no problem with those.
Have you tried stripping this character down of any irrelevant component and ability ?
Yep, no irrelevant abilities.

So far, I have tried what you suggested yesterday, and I don't have any problems now. I deleted the moveTowards locations from the ladders on the ship. I customized the scripts a bit, and it has never gotten buggy until now. If you want, we can still check, but it seems to be working now. Shortly, it works like airborne when you are swimming.
 
Back
Top