cancel
Showing results for 
Search instead for 
Did you mean: 

[Integration Notice] Avatar Grab Unity sample available

mfmf
Oculus Staff
Hey folks: we've put together a sample of using the Avatar SDK with a few scripts to add object grab/throw functionality. I've attached it here. It requires the Oculus Utilities for Unity, and the Avatar SDK. 

This isn't the end of our hand samples, but I didn't want to leave you without at least a basic grab sample for too long. 

Known issue: it works in 5.5.0f3, but crashes in all 5.4.x versions of Unity I've tested so far. For now it's a 5.5-only sample. It doesn't rely on any 5.5-only functionality, however, so you should be able to use the scripts in 5.4 without a problem.

EDIT: updated to behave well with locomotion such as OVRPlayerController, 1/3/2017.
53 REPLIES 53

KevinLongtime
Heroic Explorer
Thank you!!!!

KevinLongtime
Heroic Explorer
I can't for the life of me figure out how to simply have an avatar that grabs and can walk around. The example given shows a static camera. Seems it should be as easy as switching out the static camera for a OVR player prefab but that's not working for me currently...the hands always end up way in the wrong spot.

Dorako
Explorer
Thank you for this sample. Any ETA or timeline on other samples?
At the moment the toys in the test scene has their physics interpolation set to 'none'. This means that they are visibly juddery, especially when they are in your hands. You can fix this by setting the interpolation setting to 'extrapolate', but currently this causes objects to quickly lose their position relative to the hands. What gives? My own grabbing project does not have this issue.

StormyDoesVR
Heroic Explorer
Hey Kevin! It took me a while, but I did finally get it to work so you can have an avatar walking around and grabbing things at the same time. I followed Ben Roberts youtube tutorial for the first bit, then kinda experimented with hierarchy settings after that. Here's the link to a copy of the project I was working on, if you wanna take a look at it yourself. Hope this helps! - http://bit.ly/2imJufh

Still having trouble getting custom player avatars working though. The generic fallback avatar works, but no custom ones.

(at the time of posting this the file is still uploading. Should be done in about an hour.)
------------------------------
PC specs - GTX 1070 (MSI AERO); 16GB Corsair Vengeance DDR3; intel i5-4590, MSI motherboard (don't remember but it was a combo deal) and an EVGA Supernova 750W semi-modular.

KevinLongtime
Heroic Explorer
Thanks a ton, @Rave185 ! Once it's done uploading I'll give it a try when I'm home!

pedat2
Honored Guest
Does this code work with a Hinge Joint or a configurable joint?

AoS.Wasted
Expert Protege
🙂 nice sample / learned some things from it. Thanks!!

I know this is probably not a request thread but some simple sample with photon / pun / other networking layer would be awsome. In the mean time I'am trying myself to make this sample work with some simple PUN implementation.

But again big thanks for this example.

Codexus
Honored Guest
@Dorako, one solution is to put the physics time step at 1/90th of a second,  the drawbacks being that it could be cpu intensive for complex physics scenes and it might not be future proof as it couples the physics rate to the refresh rate of the HMD.

As for the second point, I think it relates to a comment on the code where they say they have to update the hand position in OnFixedUpdate for physics to work. I think a possible solution would be to have the visible hand + object in hand drawn in OnUpdate() and not physics enabled while at the same time have an invisible version for physics in OnFixedUpdate(). (EDIT: At least as long as the object in hand is not touching anything, otherwise you need the physics interaction)

KevinLongtime
Heroic Explorer

Rave185 said:

Hey Kevin! It took me a while, but I did finally get it to work so you can have an avatar walking around and grabbing things at the same time. I followed Ben Roberts youtube tutorial for the first bit, then kinda experimented with hierarchy settings after that. Here's the link to a copy of the project I was working on, if you wanna take a look at it yourself. Hope this helps! - http://bit.ly/2imJufh

Still having trouble getting custom player avatars working though. The generic fallback avatar works, but no custom ones.

(at the time of posting this the file is still uploading. Should be done in about an hour.)


I tried it and it did indeed work! Thanks a ton man!

Did you use your own grab code on this? @Rave185