Hang Ability - Can't Climb Down

Matt-The-Slayer

New member
I have been playing around with the Hang ability for awhile, but can not figure out what to do to fix my current issue.

My character has the ability to climb up my Hang Objects, properly transferring upward when it is supposed to... however when trying to move downward no action is taken. I have spent a great deal of time trying to figure out how to resolve the problem.

As it appears the problem stems from detection of the hitObject. The hitObject that is being detected is the same as the m_LastHangObject (or current Hang Object).
I believe this problem is due to the collision capsule cast having improper values. However in playing with the values I have seen no results, and have only further broken the ability.

Here is a screenshot with the debug line drawn.

Hang_ClimbDown.PNG
 
When the character tries to transfer down the DetermineNextHangObject method is called. If you place a breakpoint within this method you should be able to see why the character can't climb down. The goalState parameter will be TransferDown.
 
Justin, it appears that the issue was due to the collision capsule cast was covering the currently hung on object as well. I did some slight modification to the code to make it work for me, namely by manipulating the size slightly, and managed to get this to work.

Thank you for the advice!
 
Glad you got it working! What modifications did you make? I can add some variables to expose it in the inspector so you don't have to make the same changes every update.
 
On TransferDown it seems the minimum and maximum start offsets are being set with values that can't be manipulated - or at least easily.

You can see in the below code that I added/updated the boxed in values.
I believe minimumStartOffset.y was being set to 0 originally, and the maximumStatOffset.y was equal to the characters height.

The following code exists inside of Hang.cs

HangCode.PNG

For some reason with my character model, that caused the height to be encompassing the ledge i was currently hanging on when the capsule cast was made. After making these modifications I was able to have success in making my character climb up, and down my Hang Objects.

Not sure if this was the best way to handle it, but the results are the same.
 
Additionally I had to adjust the raycast start position when transferring down as the raycast wanted to start inside of the next transfer object, there for detecting no empty space above it.

I added the boxed in lines of code to remedy this.

HangCode2.PNG
 
Top