Forum Discussion
aleclock
5 years agoHonored Guest
OVRCustomHands trigger collider
Hi everyone,
using Oculus Integration and OVRCustomHand prefab, I'm trying to write a simple script that tells me which hand hitted/triggered a specific object.
I tried use OnTriggerEnter() method, but the referred collider (CapsuleCollider) doesn't have any information of the hand.
What do you suggest I do?
Thanks in advance.
Ok I got it, it worked for me :
the name of the hand colliding can be found in your Ontrigger method under : other.GetComponentInParent<OVRSkeleton>().GetSkeletonType()
NB : it return a string
if it work for you, mark this as a solution it would help me 😉
4 Replies
Replies have been turned off for this discussion
- laurisDProtege
Hi,
For get the Hand information you should just write :
private string NameOfTheHand; Void OnTriggerEnter(collider other) { NameOfTheHand = other.gameObject.name; Debug.Log("Don't forget to give LaurisD a Kudo"); }then you can compare the name in a switch or a if loop for do what you want.
Hope I helped you 😉
- aleclockHonored Guest
Thanks for your reply, but that's not true actually.
Each bone's CapsuleCollider seems to be created at runtime and it's not directly attached to the hand's prefab. So other.gameObject.name returns the collider itself and not the hand's prefab.
- laurisDProtege
Ok I got it, it worked for me :
the name of the hand colliding can be found in your Ontrigger method under : other.GetComponentInParent<OVRSkeleton>().GetSkeletonType()
NB : it return a string
if it work for you, mark this as a solution it would help me 😉
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
- 9 months ago
- 8 months ago
- 3 years ago