Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] VR Interaction Framework

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

  1. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Check your error log - you're missing a reference. Just add "using BNG;" at the top of your file. If you hit Control + . (period) on you keyboard with that red line selected, you will get the option have it added to the file for you automaticalaly.
     
    Mark_01 likes this.
  2. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    Okay so the script is working in the sence that I can select the files etc.

    However it's not switching the audio file. There's an error in the console of the project however.

    The script:
    Capture.PNG

    The project console error:
    Capture2.PNG
     
  3. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    97
    Hello BreadedNinjaGames, i am planning to use this framework for next project.

    As I read that v1.3 will support Vive and OpenVR, can I assume if I start the project with v1.2, there will be a way to support Vive easily after upgrading to v1.3? Thanks.
     
    cmart likes this.
  4. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    61
    So im having some trouble with guns- are theinternal collider components importantly placed? no matter what i do, the guns just slide across the floor or dont fire, or dont let me grab with two hands etc.
     
  5. bricefr

    bricefr

    Joined:
    May 3, 2015
    Posts:
    47
    Hello guys. Is this supposed to work on the last Unity version (2019.3.5): once compiled and just after deployment I get the spinning waiting indicator in the Quest and nothing more, have to kill the app. Same thing from a blank project or the demo (no compilation errors tho).
     
  6. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    61
    I'm also encountering something where my hands and various objects change sizes after snap points, or picking things up. is this caused by something specific?
     
  7. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    I had the same issue. You need to make sure the object you put in the snap zone has an equal X, Y, Z value. So all 1, or all 2, or all 0.2. As long as they're the same.
     
    BeardedNinjaGames likes this.
  8. ccoutinho

    ccoutinho

    Joined:
    Dec 24, 2016
    Posts:
    20
    Hi,
    I was wondering if there is any way I could start the level with guns already in my hand, without having to pick them up from the table.
    Any advice is most appreciated.
    Thanks
    Chris
     
  9. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    123
    Is it possible to make a movement between the hand and the ball as if it were a volleyball serve?
     
  10. ccoutinho

    ccoutinho

    Joined:
    Dec 24, 2016
    Posts:
    20
    While using the Inventory Object that is attached to the player, I have noticed that the Ammo Box unit will only show up when you have the model of the hand with forearms, if you switch to the controller or just plain hands the Ammo Box does not show up. Is this the way it was planned to work or is it a possible bug?
    Also I have tried all I could to get the Ammo box out of the Left Ring and have it placed in between the 2 holster Rings but it wont budge with whatever Transform settings I attempt. Is this possible to achieve or does it need to stay within the confines of the left Ring.
    Thanks,
    Chris
     
  11. ccoutinho

    ccoutinho

    Joined:
    Dec 24, 2016
    Posts:
    20
    While moving around my scene,when I encounter any object like a container or a barrel, both of which which have colliders on them, (have tried using mesh colliders as well as Box colliders), I am still able to put my hands as well as my head into these objects and see whats inside. I don't want to allow this. How can I achieve this?
    Thanks,
    Chris
     
  12. ccvannorman

    ccvannorman

    Joined:
    Jan 20, 2013
    Posts:
    11
    Update #2: The "stuck in Oculus Go" mode was a Manifest problem. I'm not sure how my Manifest got modified when I imported your framework, but it did. Simply adding the line

    <uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1" />

    to my Manifest fixed the issue. I was able to track controllers normally, pick up items, and use them in the demo scene.

    So, no more issues for now!

    Looks like a great asset! Can't wait to dig in.
    Thanks!


    Update #1: If I import the folder of the project only (not the entire project) this issue goes away.
    However, now my hands (controllers) are moving as if using IK instead of using actual controller position (so my controllers are not being tracked / going to the correct place / makes it impossible to grab and use the items in the scene). Is there some default setting I'm missing, or some layer or tag that is missing that prevents me from controller tracking?

    Note that this broke in Oculus built-in demo scenes as well. Tracking is simply broken for controllers in the entire project.

    Thanks


    Hello. I have purchased and installed the asset, and...

    Play mode stopped working with Quest.

    In my project i imported Oculus SDK and Quest is working fine. After importing your project on top, Quest stopped working in Play mode. The scene starts and there are no errors, but the Quest no longer shows the game, only the Oculus menu. Also, the Play mode window does not move when I move my head anymore. Restarting, etc does not solve the issue.

    What is causing the Editor Play Mode breakage with Quest? Any insight is appreciated. Thanks.
     
    Last edited: Mar 14, 2020
  13. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Yes, you should be ok to start with 1.2. You may need to readjust your player prefab on the next update, so I'd recommend creating your own player prefab so it doesn't get overwritten.

    Yes, the internal collider components are fairly important. For example, there can't be a box collider inside the pistol grip if you want to slide a clip into it.
    I haven't tried this on 2019.3.5 but will later this weekend (I'm on 2019.2 and 2019.3.2). Sounds like some people are having issues with it. You may want to stick with 2019.3.2 for now.

    Sure, the Grabber has a property called "Equip Grabbable On Start" - drag your item there and they won't have to pick it up.
     
  14. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,033
    Does anyone know if this works with URP, or should I stick with the default 3D Renderer? Thanks.
     
  15. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    I'm not using URP personally, but I've seen quite a few people on Discord using it. Not sure if it requires any tweaking other than upgrading materials.
     
  16. AtomsInTheVoid

    AtomsInTheVoid

    Joined:
    Jul 27, 2015
    Posts:
    170
    The IK Body is rather strangely aligned. Seems to be offset to where it should be. Where should I look to fix?

    Also, would love a video of you not only changing a hand model to a custom one but also setting up the animation with queues
     
  17. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    I'm using HDRP, and it works just fine. I had to convert all of the materials of course, but other than that no problem.
     
  18. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    @BeardedNinjaGames any idea how to solve this?
     
  19. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Did you assign an AudioClip for the silenced sound? Run a debugger and see which part is coming back null.

    Check out the BodyIK GameObject - there is a component called "RotateWithHMD" where you can adjust the offset of the body from the HMD.

    And yes, definitely going to make a video for the hand poses and animations! That is first on my list of videos to make, after sprucing up the docs a bit. v1.3 is now being tested (there is a demo on Discord), so we're getting closer!
     
  20. cmart

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    118
    How do you get access to the discord? This system looks awesome, but Im waiting for 1.3 :) I actually use oculus headset/controllers, but want to use openVR because I am targeting PC, and openVR covers oculus/vive/index.

    This question is a bit outside the scope of this product, but its so confusing with Oculus SDK, unitys new XR SDK, and openVR... for quest, obviously oculus SDK is the way to go, but does anyone have an opinion on best all around SDK for pc?

    At any rate, Im going to pick this up sometime this week. Since it already covers quest/mobile and with openVR incoming looks like this is a solid choice for PC as well. Nice to cover both bases :)
     
  21. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    I have yes, and the debugger isn't returning any issues on the script itself.

    This is how it's set up on the snap and attachment:
    cap3.PNG cap4.PNG
     
  22. bradsprojects

    bradsprojects

    Joined:
    Jan 6, 2020
    Posts:
    1
    Hi BeardedNinjaGames, I was wondering if you could help me with a couple of things that hopefully will be very straight forward:

    1. I have added a 'coin' asset to the demo scene and made it grabbable. When I grab the coin and place it into a snap zone, it is held in place at 90 degrees to how I would like it to be (I would like it to hold the coin so I can see the face of the coin, not the side of the coin). This photo shows how the coin is actually snapped into the snap zone:


    And this photo shows how I would like the coin to snap:


    Is there a straight forward way to have it snap like this?

    2. When I add a tooltip to an object (such as the coin) the tool tip ends up being linked to the coin, however the text is a long way away from the actual coin instead of being directly above / next to the coin. I have simply copied the same format as the yellow box example and yet the text is very far away when you build and run the scene. The image below shows what it looks like in the unity editor window (notice the 'coin' tag is very close to the coin):


    However when I run the scene, it actually ends up being somewhere way over here:


    Any help with either of these two issues would be much appreciated!

    Great work on this VR asset by they way and best regards,

    -Brad
     
  23. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    I think Discord was having some troubles today. There is a link on the forum post, or you can use this one.

    As for best all around SDK.. That's a pretty tough question to answer, and that answer could change at any moment, really. Right now the Oculus Integration package has OVRManager, the HandTracking rig, and some nice hand models to work with, so it's the best bet for stability and being productive with Oculus. In the next few months I imagine that the Oculus Integration Package will get phased out in favor of using the package manager. However, we're not quite there, yet.

    I'm not sure, Penhoat. That looks good to me. I would set a breakpoint and see what's not getting called. If it's the OnSnap event, or if the audiofile isn't getting assigned, etc. If you're not able to use the Debugger while in the editor, you can use VRUtils.Instance.Log("Message Here") to log when the snap point is attached.

    Hi Brad - For the coin, right now Grabbables are just parented into the snap zone, and their local rotation (euler angles) is set to 0,0,0. For now, you could just align your graphics / collider to match that rotation. In the next update you'll be able to add a "SnapZoneOffset" component that will allow you to specify the offset position / rotation.

    For the tooltip, check the "Tooltip" component's "Draw Line To" property is set to the item you want to follow around. I would recommend parenting the Tooltip to the item you want to follow, as well as setting that property.
     
  24. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Hi everyone. Due to the coronavirus I am unable to make it to the VR lab to finish testing on an HTC Vive. If anyone has an HTC Vive or WMR and can help with testing, please join the Discord and check out the pcvr-testing channel. Any help is appreciated! After that I'll be ready to send out v1.3 :) Thanks!
     
    Penhoat likes this.
  25. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    96
    Hi BeardedNinjaGames,

    We've been using the asset for a while and it's just great!
    Looking forward to the new version.

    Quick question. I've had to disable "Is Kinematic" on the rigidbody in order for the snapping and snap offset to be effective. I'm sure there are cases where you do not want a kinematic object but do want it to snap to a certain position when held.

    Is this possible?

    Thanks!
    Tom
     
  26. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Hi Tom,

    I don't think I quite understand the question, but it sounds like if you have a kinematic grabbable, then snap offsets aren't working? In version 1.3 offsets are now specified using one or more Transforms, instead of specifying a Vector3. So I'm thinking this may fix that issue for you, if I understandd that correctly.

    There's a 1.3 beta available on the Discord channel if you (or anyone) would like to get early access to that. There are quite a few new additions, including how offsets are handled.
     
  27. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    96
    Great, I'm on the discord (Fragilem17) fixed in for now by not giving the rigidbody any gravity and a lot of drag, then disabling the kinematic.
     
  28. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    193
    Hello,

    Can this work with Oculus Go controller too ?
     
  29. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    I don't have a Go personally, but it should work fine with the Go. Obviously some of the two-handed features wouldn't work, though :p
     
  30. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    @BeardedNinjaGames
    Hey hope you're well!

    I have a question. In order to get this to work with an AI asset I'm using I need to be able to apply a script to the projectile being fire. Now I have added it to the projectile fired by the gun, and when activating slowmotion, it works just fine. However since this is using raycast, it's not actually firing that projectile without slowmotion (so can't attach the script).

    Any idea how I can add that script to the raycast, or have the projectile be visible by default?

    Edit: an ETA on the new update you showed off on YouTube?
     
    Last edited: Mar 23, 2020
  31. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Is this for EmeraldAI by chance? There's an integration in 1.3 for that if so. But to answer your question, an easy way to do this would be extend the damage system and just pass your damage along to your AI component.

    For example, with EmeralAI, you could use something like this :

    Code (CSharp):
    1. public class EmeraldAIDamageable : Damageable {
    2.  
    3.     public override void DealDamage(float damageAmount) {
    4.         if (GetComponent<EmeraldAISystem>() != null) {
    5.             GetComponent<EmeraldAISystem>().Damage((int)damageAmount, EmeraldAISystem.TargetType.Player, null, 400);
    6.         }
    7.     }
    8. }
    Now anytime a weapon deals damage (raycast, physics based, etc.) it will transfer over to the EmeralAI system. The same concept applies to any other type of object that can receive damage.
     
  32. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    No unfortunately it's FSM AI, seemed a lot more compelling to use.
     
  33. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    The same concept applies. Any time you deal damage to a collider, this script will then act as a bridge to transfer over the damage. Just need to know how to deal damage to your system and then send it over.
     
  34. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    195
    Any news on 1.3?

    Thanks.
     
  35. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Found a couple of bugs in 1.3 that I'm fixing before submission. If you'd still like to start using 1.3 in the meantime, email me or join Discord and I can get you access to the beta. Still has those bugs, but you can start using some of the new features until that is patched.
     
  36. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    195
    TBH we are waiting for the other head sets, HTC Vive implementation in 1.3.
    Is that what is causing the bugs?
     
  37. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    1.3 is using a new Character controller based on Unity's own implementation right?
     
  38. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    The HTC Vive implementation is in good shape. I reworked how some of the physics work when swinging objects really fast - in the current version it's possible to have an item get stuck in the table if you swing it very fast. That's been fixed, but it caused a couple of other issues to crop up when teleporting or moving quickly using smooth locomotion. However, the biggest hold up has been the fact that I no longer have access to a HTC Vive (due to covid-19), so getting that tested was very slow. Future updates shouldn't be so drawn out.

    I've also started on a public roadmap for the framework, so everyone can see what I'm working on, as well as known issues, what's coming up next, and some ideas for the future. I'm slowly pulling over Trello cards from my private board, so expect this to continuously be updated.
     
    Mark_01, Abnormalia_ and Penhoat like this.
  39. JDrem1

    JDrem1

    Joined:
    Jun 24, 2017
    Posts:
    195
    Great news, pleased the HTC Vive implementation is going so well. Looking forward to its release.
     
  40. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    363
    Does your system use XR inputs for cross platform integrations ?
     
  41. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    I just submitted v1.3 which adds support for XRInput (Unity v2019.3 and up). HTC Vive is working well, but the WMR Controllers are currently Offset 90 degrees. Will look to fix that in the next update.
     
    LaCorbiere and Penhoat like this.
  42. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    @BeardedNinjaGames what would be the easiest way to setup my own hand model? Got one from the asset store as a test, how would I set this up?
     
  43. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Under the player transform there is a "HandControllers" gameobject which contains transforms to hold the left / right controllers. In there you'll find all of the models used in the demo : "CustomHandLeft", "CustomHandLeftWhite", etc. This is where to put your hand models.

    On the LeftController and RightController you'll see a component called "Hand Controller". This determines controller properties such as grip amount, point amount, and thumb amount, and then passes these properties on to the hand model's animator. If you are holding a Grabbable that is using a custom hand pose, then that "PoseId" will be sent to the animator as well. It may be helpful to take a look at the included hand animators in the Animation directory (1.3).

    Depending on how your hand is setup you may just need to rename the layers for pointing, gripping, and thumb.
     
    Penhoat likes this.
  44. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    363
    Regarding the Bow / Arrow ) setup - You use several sections for the bow. Would it not be easier to use an animation of a bow bending ?
     
  45. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    891
    This looks more and more tempting.
    Does this framework support opening drawers manually?
     
  46. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    @BeardedNinjaGames
    Really impressed by the new update!

    Impressions so far:
    - Loving the doors, including cupboards and drawers, awesome stuff.
    - The destroyables are great, really adds to the whole VR interaction concept.
    - Appreciate the new guns!
     
    BeardedNinjaGames likes this.
  47. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    Yes
     
    atomicjoe likes this.
  48. BeardedNinjaGames

    BeardedNinjaGames

    Joined:
    Jan 26, 2020
    Posts:
    126
    Yes, definitely use an animation! I think it's fair to say that lovely pink and teal bow is programmer art :p I would like to replace it with an actual mesh, like the pistols are now.

    Thanks, Penhoat! I'm really happy with the sliding door. I'd like to keep expanding on the hinge doors by adding things like velocity and options to open them with buttons / triggers. That work should translate to other hinged interactions as well, such as for knobs / dials and a steering wheel.
    There are two drawer examples included, and I would recommend checking them out in the demo on itch.io or sidequest to make sure they would work for your application. I've found drawers to be quite tricky.

    I'll be posting a video of the new features in 1.3 soon, as well as a more exhaustive list of what's been updated and added.
     
    atomicjoe likes this.
  49. Penhoat

    Penhoat

    Joined:
    Mar 2, 2020
    Posts:
    88
    I'll be using the sliding doors for panels as well, love the concept.
    Already used the crate concept to have some different destroyables. So simple to use those scripts for your own purposes, great stuff.
     
    BeardedNinjaGames likes this.
  50. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    363
    Scaling Objects ?
    How to hold an object and scale it with the controllers ?
     
unityunity