Search Unity

[RELEASED] VR Interaction Framework

Discussion in 'Assets and Asset Store' started by BeardedNinjaGames, Jan 28, 2020.

  1. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Take a look at /Scripts/Components/ScaleBetweenPoints.cs for an example of how to scale between controllers / positions. The idea is to measure the distance between controllers and scale based on that value.

    Here's a video outlining some features for v1.3 :



    And here are a few more detailed notes :

    1. Added XRInput support for Unity versions 2019.3 and up. This allows HMD's like the HTC Vive to now work properly with the framework. Windows Mixed Reality support is almost there - the controllers are rotated 90 degrees, should be a straightforward fix.
    2. Added 3 door examples : sliding door, door that requires handle to open, and double doors.
    3. New weapon models for pistol, rifle, and knife (courtesy of @BATTLEKOT)
    4. New Grab Point system allows you to specify multiple grab points on a grabbable, as well as constrain their rotation. Try picking up the knife by the hilt with different grips to see how this works.
    5. Fixed issue with IK Body not rotating during climbing
    6. Added Joystick Deadzone support
    7. Separated LocmotionSelector out from DemoScript
    8. Better remote grab rotations - nice and smooth now!
    9. Including some basic FinalIK / VRIK and EmeralAI integration packages
    10. Lots of bug fixes, physics tweaks, and performance improvements
    I've also started working on a Roadmap if you're interested to see where this is all headed - happy to receive any feedback on that. I will continue to fill this in as I move forward. The next version (1.4) will be focused on tutorials, documentation, and polishing.
     
    Mark_01, attaway, overthere and 2 others like this.
  2. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    I wouldn't go down the route of SteamVR at the moment. The new XR Management system doesn't support OpenVR/SteamVR. Until there's a plugin for SteamVR it could mess things up if people are already using the XR Management system... learned that the hard way.
     
    atomicjoe and BeardedNinjaGames like this.
  3. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Can you please make some video tutorials ??? thank you!
     
  4. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    @BeardedNinjaGames
    I ended up caving and getting EmeralAI because of the integration (and it honestly looked like Invector AI just wasn't meant to work with VR). Do I need to do anything special for the integration?
     
    pushingpandas likes this.
  5. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Working on those now! Anything in particular you're looking for?

    There's a package to extract located in /BNG Framework/Integrations/Emeral AI/ as well as some instructions in a text file.

    Basically you attach the EmeraldAIDamageable component to any AI gameobject that needs to be damaged. This takes our damage and passes it along to the emerald system. Then you need to assign the CharacterController a new Tag (EmeraldPlayer, for example) and assign that tag in the emerald settings, to make sure the AI can see the player. It's covered better in the instructions.txt, but that's the gist.
     
    Penhoat likes this.
  6. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    Custom hands would be a nice one. Been a nightmare so far. Top of that, any assets in the asset store seem to have no support from their devs, which doesn't help either.
    Thanks for this. Works just fine! So far EmeralAI has been a slow process. Compared to Invector it takes ages to setup and animate. Let's hope this'll be worth it haha.

    @BeardedNinjaGames how would the AI actually damage the player?
     
    Last edited: Apr 3, 2020
    sjm-tech likes this.
  7. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    - setup new weapons
    - emerald AI integration
    - FinalIK Full body

    thank you :)
     
    jeremiasz and sjm-tech like this.
  8. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    One tip i can give you on the weapons. I created a vector, which has a completely different type of body build, but considering it's a rifle as well, I copied the rifle. Made a new vector mesh, put it in the graphics folder and removed the rifle body. Then move around the trigger, colliders, grips. Create a new slide as a child of the existing one, but remove that mesh. Result is fully functioning vector (you can alter its stats)

    That's the nice thing of the guns being so modular in their build :)
     
    BeardedNinjaGames likes this.
  9. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I was actually hoping that the new version already had full SteamVR support. Currently, SteamVR/OpenVR is by far the most polished and feature-complete VR API available. Unity is trying to catch up but they've had a pretty sad history with everything related to VR since 2015, so I'm not particularly hopeful. At the moment, Unity is just messing things up - like usual (at least they did finally adopt many of the concepts that OpenVR was built upon, since the very beginning; too bad they are doing it in a way that broke compatibility).

    So ... is skeletal input (using SteamVR) still on the table?
     
  10. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    It's certainly still on the table. At this point I feel like Unity XR / OpenVR support could still be quite a ways off. I'd love to be wrong, though. I've got a few items to wrap up on the roadmap, and then will swing back around to SteamVR and Skeleton Poser.
     
    jashan likes this.
  11. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    199
    Cant seem to get smooth loco with the HTC Vive.
    Left thumb pad does not toggle it.
    It is enabled in the inspector. Have even tried removing the teleport script, but still no joy.

    Any ideas?
    Thanks.
     
  12. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Make sure Smooth Locomotion is on in the "LocomotionManager" (on the Player object), and you also want to disable "Load Locomotion from Prefs" as well - that may be overwriting the setting.

    The Vive uses the trackpad to initiate the teleport, so I disabled the teleport / smooth locomotion toggle for HTC. Otherwise when you pushed it in to teleport it would just toggle to smooth motion.
     
    JDrem1 likes this.
  13. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    @BeardedNinjaGames How would one setup the Emerald AI player health system with the OVR character controller?
     
  14. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    199
    Just wanted to say thanks for the advice, that did the trick, and now its running really smoothly.

    I did have a quick question regarding climbing.
    Is it possible to set an entire mesh as climbable? or even terrain?

    I just wondered, because while setting smaller blocks they can be grabbed on the same face at multiple points.
    But when I tried on both a cliff face using Unity terrain, and a huge cube. Both with colliders, and the grab script, it did not work.

    I didnt try subdividing the mesh,and applying the scripts, as I was trying for performance.

    Is it possible to have this working?

    Again thanks for the support of this cracking asset..
     
  15. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Ah, I'm glad you mentioned this. If you set the "Break Distance" property on the Climbable component to something high it should work on your mesh. The break distance property lets you "break" the grip if the distance between your hand and the transform exceeds a specified distance (1 meter by default), so on a big mesh you're breaking the grip as soon as you grab it since the center of the transform is most likely > 1 meter away.

    I will update this so break distance uses your original grab position instead of the center of the transform. That would be a better way of handling this. For now you can just set the Break Distance to something relatively high or 0 to disable the break distance feature.
     
    JDrem1 likes this.
  16. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    199


    Works like a dream, even on terrain

    Thank you.
     
    Last edited: Apr 7, 2020
  17. muddmaster

    muddmaster

    Joined:
    Jan 27, 2019
    Posts:
    13
     
    BeardedNinjaGames and Penhoat like this.
  18. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    Thank you my good man
     
  19. muddmaster

    muddmaster

    Joined:
    Jan 27, 2019
    Posts:
    13
    I will try to make more videos I'm having some issues with sound.
     
    Last edited: Apr 7, 2020
    BeardedNinjaGames and Penhoat like this.
  20. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    @BeardedNinjaGames

    Good idea for a tutorial would be on using the UI Example you've added to actually change game values, like player settings for example :)
    That way it could be used to toggle between locomotion types, or enable post processing settings in the game (as an example).
     
  21. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    The Sceneloader you have in there (on death), custom I assume?
     
  22. muddmaster

    muddmaster

    Joined:
    Jan 27, 2019
    Posts:
    13
    It's another asset i own you can use a free one it's should work as well
     
    Penhoat likes this.
  23. muddmaster

    muddmaster

    Joined:
    Jan 27, 2019
    Posts:
    13
    In this video you can see where i put the UI at on his hand
     
    Penhoat likes this.
  24. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    On sidenote. Are you running Emerald AI 2.4.1? I notice your AI is using ranged attacks, and for me they don't work (not just me, several people running into the same issue).
     
  25. muddmaster

    muddmaster

    Joined:
    Jan 27, 2019
    Posts:
    13
    yes i'm using 2.4.0.1 on unity 2019.3.3f1 I'm still playing with the ranged attacks .
     
    Penhoat likes this.
  26. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    Coming from a easy setup (SteamVR) which out of the box is easy for ALL platforms ;)
    I would like to love this asset, because it comes with stuff like inventory, stick, remote grab things that i need. :p

    However, i found controls work fine with oculus, but not HTC, so now im questioning does it work with Index?

    Also where do i make adjustsments for controllers.? Example.

    On my rift s, the demo scene works fine.
    On my HTC cosmos, only the thumbstick buttons and slowmotion works, everything else NOT.

    I need it to work, any ideas?

    I also get the feeling, this is more for mobile development and not so much pc development,
    there is a lot of focus on android in this.
     
  27. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    Hehe also a funny one, was trying to see if i could run it in a old game where i allready have steamVR and Steam implemented :p
    Maybe to convert from SteamVR to this (when we get controllers confirmed working)

    Funny IK screenshot when SteamVR and OculusVR and VR interactions running at the same time.. :D



    https://imgur.com/a/2BbynAB
     
  28. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    SteamVR doesn't work with the Oculus Quest, which I consider a very important platform.

    If you're looking for OpenVR support (so this runs through Steam), then just make sure the OpenVR SDK is set first :



    This will support devices such as the HTC Vive. Unfortunately OpenVR / Unity XR doesn't support the Valve Index, so if you want to run the Index you'd need to add the bindings from SteamVR yourself. That's just where Unity XR is at the moment, and not really something I have any control over. I may add SteamVR as an integration package in the future, but for now if you're familiar with SteamVR it shouldn't be too difficult to update the inputs in the InputBridge based on SteamVR actions.

    This is intended for both PC and Quest development. There tends to be more of a focus on the Quest when doing tutorials, simply because there are more steps for supporting that platform. For PC you pretty much just import the Oculus Integration Package and this asset and hit Play. For the Quest you need to perform a couple of additional steps to make sure it runs smoothly.

    I also target the Quest when creating the Demos, as it's much easier to scale up from there than it is to scale down from a PCVR setup. It's a great performance benchmark. That's beneficial for PCVR users, as if we're hitting ~72FPS on a Quest then you should have plenty of room to add additional visuals / features for your PC build.
     
    Mark_01 and Vaupell like this.
  29. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Here are some tutorial videos - I hope they help! I'm looking to get a v1.31 version out soon that has some minor updates and fixes, then I may look at doing some more in-depth videos if there is interest.





     
    Mark_01, attaway, muddmaster and 2 others like this.
  30. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    Thank you for a speedy response, love the asset and might use it in a future project.
    Currently i was just looking for a few things i need.

    - Remote grab
    - And the small inventory pack/item slot system
    - belt slots

    If you have any interaction systems similar with these things, i would happily pay 50£€$ for that if they support SteamVR.
    I know steamVR is implementing XVR, but they are very slow over at Valve, so i wont exspect them to be ready until 2021 at the earliest.

    Considering my current users consist of 22% index users and increasing, i'm sticking with SteamVR for now.
     
  31. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    I'm interested in this very much but I have some questions about compatibility with HTC vive. I know it says it supports vive and i even played the demo with my vive.

    However they were some control issues when grabbing things and it was uncomfortable. The side button on the controller was used to grab the items and you had to continually hold it and that was a pain.

    I'm guessing there will be a way to change the buttons to the grip button to hold right?
     
  32. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Hey there. I don't have easy access to a Vive at the moment due to Corona, so I kind of have to guess at what would work well for controls. You can certainly change the grab to use the trigger instead. I chose the side button as that seemed to work best if I want to hold a pistol and then use the trigger to shoot. Certainly open to suggestions! I'm not sure what the standard is for Vive.
     
  33. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Ok. I figured if you press the side button to pick, you shoot with the trigger. But in the demo, I had to keep holding the side button to hold onto the gun which was uncomfortable. Can it be done that way?
     
  34. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Any chance for game creator or playmaker integration????
     
    jeremiasz likes this.
  35. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    I'm trying to make that work at some point next week.
     
    jeremiasz and pushingpandas like this.
  36. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    The Respawn function in the Emerald Damage Script does not work. I Flase Destroy on Death and set Respawn True with 10 seconds. Once NPC is dead, it stays dead.
     
  37. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Yes, that could work. Might be weird when trying to throw the item. I will set up one of the pistols as a toggle and post the PC demo up later so you can test the difference yourself.

    The included Emerald Damage script only transfers damage from the VRIF system to Emerald. Anything AI related should then be handled through Emerald's system. So however you might respawn an enemy in Emerald should work fine.

    I haven't really used PlayMaker before, so not sure what that would look like. Anything in particular you're looking for? I would think you would still be able to use PlayMaker just fine with this, and use the included UnityEvents with VRIF to handle anything Grabbable related.
     
  38. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    99
    Yes Playmaker works just fine with this. You can set the scripts on items with your scripts and it all works fine.
     
  39. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    OK thank you. How can I make Emerald AI to damage player?
     
  40. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Another question. I enter in the damage script Health 10000 but the emerald AI dies after one hit with the gun?!
     
  41. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    I figured if you want to throw the item then you can just unequip it but it should depend on the type of item though. Like throwing stars or balls you should hold button to hole onto item and release button to drop. But for items like guns and swords then maybe you can equip so you dont need to keep holding. It would probably depend on the type of game. I was just playing half life alyx and you dont hold a grip to hold onto a weapon.

    Anyway im looking forward to the demo. I want to test it out before buying.
     
  42. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,204
    @BeardedNinjaGames

    Hey, what would be the best way to allow for a player to remain seated, but keeping the height at standing eye level?
     
  43. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    Not part of the sale :(
     
  44. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    It's totally worth it at full price. If you've ever tried using the Oculus plugin's prefabs and found them to not function or be full of bugs, or used VRTK and found it to be way over-engineered, or worked with Unity's XR framework and just be totally lost on where to start, this plugin solves all those issues.
     
    Mark_01, muddmaster and toddkc like this.
  45. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    I don't doubt that it is. I just have like 100 things in my wishlist and the sale ones are definitely going to get purchased first :)
     
    Schneider21 likes this.
  46. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    I hear ya. If you're just buying to build up your asset library, definitely get your sale items first. But if you're trying to get a VR project going now, don't hesitate!
     
    toddkc likes this.
  47. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,204
    So I'm trying to use my own character with this system, but I'm having trouble grabbing objects. I copy-and-pasted the 'GrabberOffsetLeft' to my characters left hand. When I add the 'PistolNEW' prefab to my scene, I'm able to point at it and the circle on the gun shows, but I can't seem to grab it. It seems as though the input system isn't set up correctly. What I'm doing is setting up my player exactly as the 'PlayFinalIK Variant', so I have all the scripts attached to the correct objects. There's something I'm missing. Thoughts?

    Thanks!

    @BeardedNinjaGames , it would be great to have a video tutorial on how to set up a character from scratch. :)
     
  48. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Currently the Player has to have the "Player" tag on it in order for the InputBridge component to be found (Uses GameObject.FindWithTag()). In the upcoming update this will be a singleton so you don't have to use a tag.

    I'll make a video once I've finished this first pass of the input system. This should be able to be hooked up to just about any rig (Steam, XR, Oculus, etc.) and I agree it would be helpful to show how to hook it up to a custom character from scratch. Now that I've had some time using this with other systems besides Oculus I have a better idea of how to abstract that. More to come on that later.
     
    jashan and DigitalAdam like this.
  49. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,204
    @BeardedNinjaGames

    Hi, where would I make the camera adjustment so when I'm seated the eye level would be at the characters standing height when using VRIK from FinalIK? I tried changing the OVRCameraRig to Eye Level and that was way to high. I also tried moving the IKHeadTarget, and that fixed the VRIKs heads position, but it did not move the camera rig. I tried moving the TrackingSpace, but that always gets reset to the HMD position. Thanks.
     
  50. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    176
    Take a look at the included FinalIK scene. If you hit the 'A' button your character will reset it's height depending on where your HMD is. So if you squat down and reset, the character will become very small. You can see me resize a couple of times in the Youtube tutorial :