Jump to content
 
tired

OnStateChanged Event

Recommended Posts

I tried to use handtracking in my own scene but the Grab class seems failed to get updated state code.

I have notice in sample scene the event doesn't have a parameter on Unity Editor GUI. But in my own scene there is always one. Is this causing the issue by overriding the state code from GestureProvider?

I use the player prefab provided by SteamVR, and I put GestureProvider under it's VRCamera. The camera tracking works fine.

SampleScene.png

MyScene.png

Share this post


Link to post
Share on other sites

Hi @tired

Please select the OnStateChanged method in dynamic int (red box), not the one in static parameters (black box). The dynamic version will send actual state to Grab script, while static one will always send fixed state (in your case 0) to Grab script.

event.png.7af030441b9ce68385b22188ac1819a3.png

Share this post


Link to post
Share on other sites
7 minutes ago, zzy said:

Hi @tired

Please select the OnStateChanged method in dynamic int (red box), not the one in static parameters (black box). The dynamic version will send actual state to Grab script, while static one will always send fixed state (in your case 0) to Grab script.

event.png.7af030441b9ce68385b22188ac1819a3.png

Thanks for the fast reply! Is there a good way to add colliders to fingertips?

Share this post


Link to post
Share on other sites
Posted (edited)

How do you make Grab work in Sample scene?

Edited by tired
mistake

Share this post


Link to post
Share on other sites

Hi @tired

You can select collider type to add collider by hand renderer, it adds collider for all joints.

1297129170_.png.221eb2e15b486829129a135055ca8c50.png

If you want to add colliders for fingertips only, you need to create custom scripts for this. You can reference hand renderer script for how to add colliders. Basically, you need create a few spheres colliders and update their position to match finger tip position.

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...