Hello there! Recently, I was playing around with Nexus VR Character Model 2.0 and decided to mess around with tools for a bit. I ended up making a sword fighting system, complete with parrying/blocking and attack force requirements. Theoretically, it would work with any VR Character system, such as custom ones. I used Nexus as I didn’t have the time (or brain power) to make my own to open source, and since Nexus is already open source it’s great for quick projects in my opinion.
You can see some test footage a bit after here, and a direct explanation of how everything works is available before the timestamp (beware my VR headset’s poor mic quality).
You can also grab it here.
A basic Read Me is in the package that described installation of Nexus VR (if you want to use Nexus with it), and the tool itself. It is NOT cross compatible with Non-VR, however your sword is blocked by any tool, meaning the default Classic Sword would still work. It’s an extremely simple script, and it’s mainly just an experiment. Still though, I thought I’d open source it so new developers can get an idea of how they might script VR combat.
FOOTNOTES:
If you’re making a game, I recommend you just look inside the scripts to get an idea of how you could script your melee system, or heavily modify it to fit your game. This isn’t absolutely perfect for most games.
It uses RenderStepped since it was entirely a prototype. This means it doesn’t account for framerate unblockers or lag. This shouldn’t be that much of an issue, it just changes the force you need to swing with.
It has an artificial cooldown. It’s not based on physical speed like Blade and Sorcery or Boneworks. It activates the hitbox at a certain speed, but it doesn’t actually increase damage or anything if you swing properly or not. The artificial cooldown ensures you can’t rapidly shake your hand and do more damage than normal.