Plugin

[=;157282]
I plan to make an example of how to set up once I get it set up myself, if you’re willing to wait a couple of days.
[/]

Thank you! That would be very much appreciated! And thank you also, , for your quick and detailed response. I think I have a basic understanding of how would be done. Now I would just need to see it implemented, as seems to be currently working on. I appreciate your patience with me as I am still new to Blueprints and coding in Unreal as well as using the Hydra. You have been a great help so far! :slight_smile:

@, no rush on these questions, but I am curious.

I’m using the -1 * (RawInputleft + Right)/2 method, and subtracting the offsets.

Right now, I have to swap X and Y, and also negate the raw Y value. I tried debug rendering but didn’t manage to get it working before I got the actual hand motion basically working.

I’m also having to add some to the Z position after doing the offset subtractions, by about 100 units.

Anyway, thanks a lot for your help, I’m going to keep banging on and tweaking it up weekend and will release some video and a sample soon.

Fixed the last of my issues - the offset upwards I was having to add was my fault, I had a number backwards somewhere. It seems to work quite well, though I’ll need to get the Oculus Config Utility height value to better match the character to the player. The character is shorter than me right now I think, so my hand ends up about 1ft below where my RL hand is.

Anyway, many thanks for your help, I’m going to hook up the rest of the stuff and get an example ported over into the VR Game Template soon.

Can’t wait to see it! :slight_smile:

[=aialexander;158693]
Can’t wait to see it! :slight_smile:
[/]

I’m gonna dump some screenshots of the blueprints on ya, they are very simple so it should be quite easy to replicate. I can’t go into super detail on each right at the moment but feel free to ask questions and I’ll get to them at some point. I still plan on porting into the VR Game Template soon.

Edits incoming.

Copy the Hydra Plugin into your project dir and enable it in the Plugins menus, restart.

Make a new BP derived from HydraPlayerController. I called mine DHydraPlayerController, D being for Dungeon (Survival).

Go to World Settings and set the game mode override settings to use your HydraPlayerController BP you just made.

Ca3Vq5N.png

is in the Hydra player controller. Notice the variables there and the function Calibrate Hydra (I use start, easy to find on the controller). The base offset one is just a static 40 in Z, it doesn’t change. I could use a float but I plan on doing a more thorough calibration step in the future to get more exact mappings, so I’m leaving it as a vector for now. The midpoint we calculate.

Next comes the Calibrate function, also in the controller:

Next we’re going into the character’s animation blueprint

nNDvRJP.png

First, add these variables

ukCNya0.png

Then create this (looks messy but is simple). Pull off the character node to get the controller.

The last step is to set up something like in the AnimGraph. Ignore the wiring that goes off screen, it’s just doing a static rotation to fix the default hands for my particular character.

Didn’t notice those nodes were selected in that screenshot - there’s no significance to it.

I’m using component space for the IK target positions.

Nicely done , the setup looks very clean. I especially like that you have your animation setup with an alpha blend that is becomes enabled after you calibrate, I did something similar and is the correct way to support different control modes.

The only thing left to do is scaling the arm output based on user to avatar arm ratio. I also think that knowing your avatar’s shoulder midpoint (e.g. via a socket) would allow for the base offset to be calculated automatically and relative to the avatar. Will take a look at myself when I get the time.

Keep up the great work!

[=;159057]
Nicely done , the setup looks very clean. I especially like that you have your animation setup with an alpha blend that is becomes enabled after you calibrate, I did something similar and is the correct way to support different control modes.

The only thing left to do is scaling the arm output based on user to avatar arm ratio. I also think that knowing your avatar’s shoulder midpoint (e.g. via a socket) would allow for the base offset to be calculated automatically and relative to the avatar. Will take a look at myself when I get the time.

Keep up the great work!
[/]

Awesome, I’ll see if I can mess with that next, seems reasonably straight forward.

I changed how I’m doing the IK and got far better results (using FABRIK instead of two-bone).

I tested setting it up so the FABRIK chain went from the hand all the way to the spine, and it actually worked, though it looks hilarious. I’m going to set it up right so the target is the Rift position and goes from the head to the spine, so that players can bend over and then reach out with the hands.

Thank you, thank you thank you! Thank you! I will read them immediately! I can’t wait to get working in conjunction with the oculus!

@

So I got as far as the Anim Graph before I hit a wall. I got everything set up, but I don’t know where the wires need to go from Component Space back to Local since there don’t seem to be any nodes that will allow me to pipe more than one node at a time. I’m using the default Hero TPP Animation Blueprint from the Rift Template built by In the hopes that I can find a way to combine the two.

[=aialexander;159270]
@

So I got as far as the Anim Graph before I hit a wall. I got everything set up, but I don’t know where the wires need to go from Component Space back to Local since there don’t seem to be any nodes that will allow me to pipe more than one node at a time. I’m using the default Hero TPP Animation Blueprint from the Rift Template built by In the hopes that I can find a way to combine the two.


[/]

Drag from the state machine’s local output to the Local to Component node right before the Two Bone IK node for the Left Hand (make sure to set that up btw, it needs the left hand bone set, as does the Transform (Modify) Bone node and the others too, for the right hand).

Then from the component wire on the first (one on top) Transform (Modify) Bone node, go to the Two Bone IK node below. Then from the Component To Local node, drag back onto your HeadOffsetBlendSpacePitchYaw node.

[=;159298]
Drag from the state machine’s local output to the Local to Component node right before the Two Bone IK node for the Left Hand (make sure to set that up btw, it needs the left hand bone set, as does the Transform (Modify) Bone node and the others too, for the right hand).

Then from the component wire on the first (one on top) Transform (Modify) Bone node, go to the Two Bone IK node below. Then from the Component To Local node, drag back onto your HeadOffsetBlendSpacePitchYaw node.
[/]

Wow, I feel really silly for not seeing that. Thank you for your help. I won’t be able to take your advice for a couple days but I’m sure I’ll have better results once I try it out.

may seem like a dumb question, but how do I go about setting up the left and right hand bone set? Is there a way to specify what bone in the skeletal mesh that I need? I noticed there was an option to insert coordinates, but I’m not altogether familiar with how to obtain them. I’ve been looking but I haven’t yet stumbled upon the answer.

[=aialexander;159363]
Wow, I feel really silly for not seeing that. Thank you for your help. I won’t be able to take your advice for a couple days but I’m sure I’ll have better results once I try it out.

may seem like a dumb question, but how do I go about setting up the left and right hand bone set?
[/]

Just select the node (Two-Bone IK or Transform (Modify) Bone as the case may be) and in the Details panel for it, it will have a drop down to specify the bone.

I’ll be updating my little tutorial there with a better setup, using FABRIK nodes. I’ve noticed they are far more stable than the two-bone setup.

I’m working on getting it so that it has a FABRIK chain from the head to the spine, with the target being the component space pos of the DK2. That should allow for leaning over/down to extend your reach (making it easy to grab things without also having to reposition with the controller every time, or things above or below you). Eventually I want to set up further IK controls for crouching down under certain conditions (rather than bending at the waist) as well as moving slightly if the DK2 target can’t be met (i.e., the player took a step IRL).

I had some really intense moments in my game while being able to control the hands, and expecting to look down and see RL, but instead seeing the character and game. Being able to reach out and grab things is amazing.

[=;159676]
I’ll be updating my little tutorial there with a better setup, using FABRIK nodes. I’ve noticed they are far more stable than the two-bone setup.

I’m working on getting it so that it has a FABRIK chain from the head to the spine, with the target being the component space pos of the DK2. That should allow for leaning over/down to extend your reach (making it easy to grab things without also having to reposition with the controller every time, or things above or below you). Eventually I want to set up further IK controls for crouching down under certain conditions (rather than bending at the waist) as well as moving slightly if the DK2 target can’t be met (i.e., the player took a step IRL).

I had some really intense moments in my game while being able to control the hands, and expecting to look down and see RL, but instead seeing the character and game. Being able to reach out and grab things is amazing.
[/]

Ooh that sounds awesome, let me know how you get along with FABRIK, never had the to mess with it myself, but might make overall displacement/leaning code cleaner. So far I’ve just used bone rotations to create the shoulder rolling and head to body displacement, if you do all those rotations before you do the IK, the IK will adjust to the new sum of all the bone rotations.

For me, 1:1 hand control and grabbing things/ledges transforms the experience from a game into a VR world. The challenge is to build upon that and make the interaction feel natural, even with limitation we currently have (no haptic feedback, no leg motion in casual experience/etc). Quite a lot of new input research still needed in area. Exciting times!

[=;159642]
Just select the node (Two-Bone IK or Transform (Modify) Bone as the case may be) and in the Details panel for it, it will have a drop down to specify the bone.
[/]

Oh I see, okay, I will be sure to check there in the future. Again, thanks for all the help you’ve given me so far. I really do appreciate it! I can’t wait to check out your FABRIK tutorial!

[=aialexander;159750]
Oh I see, okay, I will be sure to check there in the future. Again, thanks for all the help you’ve given me so far. I really do appreciate it! I can’t wait to check out your FABRIK tutorial!
[/]

THe of it is to just replace the two bone IK nodes with a fabric node, and do a Make Transform (plug in the position and rotation of the hydra per hand). Set the chain tip to be the hand, the root to be the upper arm.

Then set the rotation to “copy target rotation” - that makes it so you don’t need the “Transform (Modify) Bone” nodes.

Also multiply the position of the hydra by 0.5, no idea why that works but it does (may or may not work with the regular setup).

Awesome! I’ll give that a shot when I get a tomorrow! I’ll be sure to let you know if I have any other questions!

or anyone else that’s tried, have you had any luck getting the HMD position? I tried and get 0,0,0 always, even when positional tracking is definitely working. I’m trying to replicate the Couch Knights setup, but without any real luck, as without the HMD position it doesn’t actually do anything but give you the normal non-HMD camera transform.

@ I have managed to replicate the action you are talking about. when you lean left, right, back, forward, The upper body follows. I’m at work right now but i will post a screenshot when I get back.

Do you update your plugins for preview builds of UE4. I only ask because now that 4.5 preview is available I wanted to try it out.

[=;159979]
or anyone else that’s tried, have you had any luck getting the HMD position? I tried and get 0,0,0 always, even when positional tracking is definitely working. I’m trying to replicate the Couch Knights setup, but without any real luck, as without the HMD position it doesn’t actually do anything but give you the normal non-HMD camera transform.
[/]

It will work but remember that you need to launch standalone and you require the app to go fullscreen before it reports the position, otherwise as far as UE4 is concerned the HMD is off.

[=Mrob76u]
Do you update your plugins for preview builds of UE4. I only ask because now that 4.5 preview is available I wanted to try it out.
[/]

I don’t update to preview builds in order to make the plugin upkeep manageable but it would be trivial to recompile it yourself.

  1. Create an empty/template 4.5 project, add some code (e.g. empty pawn class).
  2. Drag the 4.4 plugin into your template project
  3. Right click your uproject and select generate visual studio project files, will add the plugin to your solution.
  4. Open your solution in Visual Studio, F7 to Compile.
  5. Copy the 4.5 compiled plugin back to the project you wish to use it for (can be without code).

if you wanted to do on an already existing project with 4.4 plugin then:

  1. Ensure you project has code, add dummy class if needed.
  2. Find your project .uproject and right click -> switch Unreal Engine version
  3. (Optional if correctly configured) Right click your uproject and select generate visual studio project files, will ensure the solution is up to date.
  4. Open your solution in Visual Studio, F7 to Compile.

Feel free to make a pull request with the compiled version on github, if it works when 4.5 comes out ill merge it to master.