The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Is it possible to trigger an event by moving over or into a holograms position?
I am working with Hololens Emulator for my final year degree project. I am looking to make an application where a user can place holograms as markers around a room (eg. in front of doorways) and when they walk over or through a hologram it triggers an audio clip or another hologram to appear. Basically, I want to play an audio or display a hologram without the users input but rather their movement around a room.
I have completed some tutorials available but I am still searching to see if my idea is possible.
Can anyone shed some light on this? Thank you.
Best Answer
-
Optionsstepan_stulov ✭✭✭
Hey, @RonanLIT
It's absolutely possible. In fact there is not much Hololens-specific here, except that the camera transform is controlled by the hardware/OS. The rest is "usual" Unity stuff.
It wouldn't be your entire body walking into holograms but rather your head. Your basic setup is collider+rigidbody at your camera and an isTrigger-collider on the landmark (the thing you walked into). You'd usually want your head collider to be a sphere and your landmark collider be a very tall capsule if you don't want to miss the landmark vertically in other words pass over or under it. Alternatively your head collider can be a vertical capsule too, but then you'd probably want to not tilt it together with the head camera but keep it position-only synced while remaining vertical.
You will have a script with an OnTriggerEnter() method on your waypoint game object to detect the entrance moment. Just play the audio there. There is also OnTriggerExit() method so you can do something like enter-and-stay logic with a timer-based threshold.
Your landmarks will probably have world anchors on them to ensure static positioning in the room.
Finally you want to make sure your collision layer matrix is setup correctly so your waypoints system doesn't interfere with your more traditional usage of colliders for gaze and gestures.
Here are also a few of many blogposts that cover some problems with colliders in case you meet any:
https://forums.hololens.com/discussion/comment/15033
https://forums.hololens.com/discussion/comment/14774
https://forums.hololens.com/discussion/comment/15558Hope this helps.
Building the future of holographic navigation. We're hiring.
6
Answers
Hey, @RonanLIT
It's absolutely possible. In fact there is not much Hololens-specific here, except that the camera transform is controlled by the hardware/OS. The rest is "usual" Unity stuff.
It wouldn't be your entire body walking into holograms but rather your head. Your basic setup is collider+rigidbody at your camera and an isTrigger-collider on the landmark (the thing you walked into). You'd usually want your head collider to be a sphere and your landmark collider be a very tall capsule if you don't want to miss the landmark vertically in other words pass over or under it. Alternatively your head collider can be a vertical capsule too, but then you'd probably want to not tilt it together with the head camera but keep it position-only synced while remaining vertical.
You will have a script with an OnTriggerEnter() method on your waypoint game object to detect the entrance moment. Just play the audio there. There is also OnTriggerExit() method so you can do something like enter-and-stay logic with a timer-based threshold.
Your landmarks will probably have world anchors on them to ensure static positioning in the room.
Finally you want to make sure your collision layer matrix is setup correctly so your waypoints system doesn't interfere with your more traditional usage of colliders for gaze and gestures.
Here are also a few of many blogposts that cover some problems with colliders in case you meet any:
https://forums.hololens.com/discussion/comment/15033
https://forums.hololens.com/discussion/comment/14774
https://forums.hololens.com/discussion/comment/15558
Hope this helps.
Building the future of holographic navigation. We're hiring.