This post will talk about how I developed the final function of my climbing claws.
This video was my primary resource for making this system work, and came out right at the time where I was considering scrapping the feature altogether.
A lot of the videos I could find detailing how to make this system worked struggled to be applied to the latest versions of XR in Unity, but as my luck would have it, this youtube – whom I followed – put out a video on how to get it working in the most recent versions.
Velocity based building functions are something I still am very new to understanding, and I’ll be honest and say a lot of the development of this system was simply following that video directly, but as expected, there were a few elements that required tweaks to work with the systems I had in place, as well as a few errors that stemmed from the smallest things like a ! in the incorrect place (that’s coding for ya!) but eventually, I got it all working.
This is the climbing provider script, which is attached to the locomotion system of the XR Rig. The primary functions are used to determine when the system should be registering and adding velocity values for climbing, and when it shouldn’t. The technique of using an if statement to register whether the correct hands are active also returns here.
This script above found in the climbing provider is the one that alters the players position based on calculations of the velocity of the player. A VelocityContainer script is called here, which is used to register the velocity of the selected XR controller when the XRI settings are edited correctly.
The climbing anchor script above is shown here, and is applied to the climbing wall objects. This function calls the ones used in the provider, and links them to when the wall is grabbed by the player. With these two scripts running together, when the wall is gripped, the climbing provider begins registering the velocity of the controllers, and then uses that to elevate the player.
Besides these two scripts, there are a few miscellaneous ones used to make sure the gravity of the player functions correctly.
I definitely think I need to learn more about systems like these. Climbing in VR is an interesting mechanic in any experience, and the more I know about implementing it correctly, the more experiences I can apply it to in the future.