To create a second ladder, I knew I needed to extend the standard ladder volume which I managed to do fairly easily. This allowed me to place my custom ladder volume in the world and it could be used just like the other ladder.
My custom ladder variables |
Looking at the anim tree node that controlled which animations were played when in different physics volumes I saw that each volume was calling a 'PHYS_XXX' command. With this is mind I tried to create a new PHYS_ command but had no luck trying to locate the class where they were defined. I did manage to add a new variable to the anim tree node but with no custom PHYS_ variable it was a useless connection.
I enquired about this on the epic forums and got a reply which stated
slowJusco -
"The PHYS_<xxx> stuff is handled natively.Better off extending ladder volumes and adding a laddertype, then checking for that via a custom animation node."
I had already extended the ladder volume so I just needed to create a custom node which handled what type of ladder we were in.
Once this was done I realised there was another problem with my anim tree. I was using the 'animblendbydirectional' as I believed that the game would read the input command and play the animation accordingly but because the ladder volume forced the player to face forwards, any input I made other than 'idle' was calling the forwards animation. Again, I took to the forums to ask for advice and suggested I needed a node that could tell if the player was moving up or down in world space and play an animation accordingly (only when in my custom ladder volume, we don't want to break jumping and falling) and again slowJusco had the perfect answer.
The new node just had to measure the players velocity on the Z axis. If it was larger than 0 then it would play an up animation and if it was lower than 0 it would play a down animation.
My custom anim tree - handles ladder types and player Z axis movement |
Here is a video showing the movement progress so far (animations are all temporary)