Daggerfall Unity VR with the Vive Pro

Discuss coding questions, pull requests, and implementation details.
User avatar
Nystul
Posts: 1375
Joined: Mon Mar 23, 2015 8:31 am

Re: Daggerfall Unity VR with the Vive Pro

Post by Nystul » Fri Sep 06, 2019 7:24 am

how do I activate the flail? I just see my hands in vr but not the flail... ;)

Vwing
Posts: 12
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing » Fri Sep 06, 2019 9:47 am

Just realized I didn't take the flail prefab out of the Untracked folder. Sorry about that. I'll fix it right away.

Vwing
Posts: 12
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing » Fri Sep 06, 2019 9:53 am

Done. There's no activation of the flail in the demo, it should just appear in your hand now.

User avatar
Nystul
Posts: 1375
Joined: Mon Mar 23, 2015 8:31 am

Re: Daggerfall Unity VR with the Vive Pro

Post by Nystul » Fri Sep 06, 2019 12:18 pm

thank you - trying now ;)

now, I see the handle but not the chain and ball - collision/interaction with the objects seem to work though:

Image

Vwing
Posts: 12
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing » Fri Sep 06, 2019 1:41 pm

Okay. Try now.

EDIT: Also, I just finished a first pass at a VR Weapons Manager. You can enter your character sheet, select a weapon, and it will spawn it (or actually a cube representing it) in your hand. Then if you throw it at an enemy, it will damage it with the weapon. Then you can pick it up again with the laser, or go back into the character sheet and unequip/reequip it to reset it back in your hand.
It's pretty rough, but you could technically play the game like this, lol. I'll put up a video later; I worked way too late and I need sleep.

User avatar
Nystul
Posts: 1375
Joined: Mon Mar 23, 2015 8:31 am

Re: Daggerfall Unity VR with the Vive Pro

Post by Nystul » Fri Sep 06, 2019 2:21 pm

yeah now it works, thanks you ;)

this is really amazing. Swinging the flail feels good in vr!

Vwing
Posts: 12
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing » Fri Sep 06, 2019 8:27 pm

Yay! I'm glad you like it :)

Always a good feeling when someone has fun with something you made :D

Vwing
Posts: 12
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing » Fri Sep 06, 2019 10:06 pm

There's actually an interesting little hack I had to do in order to make the flail chain rotate toward the ball correctly. It turns out that SteamVR (or maybe OpenVR?) has some code somewhere that runs after all of the update functions, updating the position and rotation of the controller very shortly before rendering. Which makes sense, you want things to feel as tight and low-latency as possible in VR.

But that made it so that wherever I put the chain rotation code, it would always be a frame behind the actual transform data of the handle. It made it so that the chain was always lagging in front of or behind the ball. The fix was to slap a camera on the flail and execute the rotation code OnPreRender, lol.

Post Reply