sd805 / l4d2vr

Left 4 Dead 2 VR mod
369 stars 35 forks source link

IK system + 3rd person animations in multiplayer #83

Open InsaneGrox opened 1 year ago

InsaneGrox commented 1 year ago

I actually debated with myself if this would even be possible, but considering that source supports inverse kinematics, and the fact the viewmodels are already attached to your controller anyways, in theory for first person, you could just use IK to move the right shoulder to below and to the right of the headset, as for the left, honestly same deal, though that'd be a bit tougher, but theoretically still possible, due to the way viewmodel animations work, I'd have the viewmodel detach itself from your controllers and move simularly to how the HUD moves when doing certain actions like shoving.

As for others seeing your movements, considering it's possible with plugins or vscripts to give every player in your lobby legs in first person, I'd imagine it wouldn't be out of the realm of possibility to hijack VR player character models to move the hands with the controllers, personally for this system I'd have it disable itself for certain animation sequences (IE: reloading, downed, other sequences where it'd look strange, ect)

An alternative to the above system is adding simple detection for where your gun is aimed, and switching your aim and idle sequences around based on if you are actually aiming IRL, this'd be a lot more basic but would be able to convey at least something.

Don't take this as pressure to add something this ambitious by the way, I'm well aware this probably won't be done anytime soon because of how complex it'd be, honestly if I knew C++ I'd attempt to do it myself.