Forum Discussion
chololens
8 years agoHonored Guest
Button Touch State and/or Custom finger poses added to default localAvatar
Hi,
I am trying to find a way to get the "button touch state" in Unity of the touch controller through code. Right now I am only seeing this available in the PC SDK section. Can someone help me out here, I would like to make custom finger poses based on whether that value is null or not?
If getting the touch controllers button touch state is only available in C++ is there a way for me to ad my custom finger poses to the already default ones without disabling those? Right now a solution I had was to use the animation tool in conjunction with the grip pose scene and save those alterations out to the animator and call those animations out in script based on button presses. However this is disabling the default animations, from what I can see, when you add this to the local avatar custom pose slot.
Any help would be appreciated.
Thanks!
I am trying to find a way to get the "button touch state" in Unity of the touch controller through code. Right now I am only seeing this available in the PC SDK section. Can someone help me out here, I would like to make custom finger poses based on whether that value is null or not?
If getting the touch controllers button touch state is only available in C++ is there a way for me to ad my custom finger poses to the already default ones without disabling those? Right now a solution I had was to use the animation tool in conjunction with the grip pose scene and save those alterations out to the animator and call those animations out in script based on button presses. However this is disabling the default animations, from what I can see, when you add this to the local avatar custom pose slot.
Any help would be appreciated.
Thanks!
2 Replies
Replies have been turned off for this discussion
- chololensHonored GuestA little update. You can toggle between the default hand gestures and custom poses without having the custom pose slot override the default ones by adding a restriction in the OvrAvatar script under the Void UpdateCustomPoses() method. In there change this
to something like this for exampleif (sdkAvatar != IntPtr.Zero)
{
{
if (cachedLeftHandCustomPose != null && UpdateTransforms(cachedLeftHandJoints, cachedLeftHandTransforms))
{
CAPI.ovrAvatar_SetLeftHandCustomGesture(sdkAvatar, (uint)cachedLeftHandTransforms.Length, cachedLeftHandTransforms);
}
}if (sdkAvatar != IntPtr.Zero)
{
if (Input.GetKeyDown(KeyCode.A))
{
if (cachedLeftHandCustomPose != null && UpdateTransforms(cachedLeftHandJoints, cachedLeftHandTransforms))
{
CAPI.ovrAvatar_SetLeftHandCustomGesture(sdkAvatar, (uint)cachedLeftHandTransforms.Length, cachedLeftHandTransforms);
}
} - juanoldinhoHeroic ExplorerHi,
You can refer to our documentation using OVRInput which is available with the Oculus Utilities for Unity:
https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovrinput/#unity-ovrinput-usage
In particular see the section 'Button, Touch, and Near Touch'. You can use
Which will return true of the 'A' button of the Touch controller is pressed.OVRInput.Get(OVRInput.Button.One);
You can also refer to the OVRInput API for more methods to access to the other buttons, thumbsticks and triggers of the Touch controller.
https://developer3.oculus.com/doc/1.16-unity/class_o_v_r_input.html
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 2 years ago
- 5 months ago