Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

unity5 Realsense unitytoolkit change a game scene

康夫_上_
Beginner
866 Views

Hello
There is a question about unity5 and intelrealsense.
I'm sorry by an elementary question.
If I wave my hand using Realsense unity Toolkit in Unity.
Would it be possible to change a game scene?
Could you tell me its command?
During being busy, I'd like thank you very much, please.

0 Kudos
5 Replies
MartyG
Honored Contributor III
866 Views

There is an easy way and a harder way to do it.  Let's try the easy way first.  :)

I think that the SendMessageAction script that is included in the Unity RealSense SDK may be what you need.  SendMessageAction allows you to activate a script when a certain action (such as a 'wave' gesture) is detected.  SendMessage is in the 'RSUnityToolkit > Actions' folder of your Unity Assets panel if you have imported the Unity Toolkit into your project.

https://software.intel.com/en-us/articles/using-the-unity-toolkit-sendmessage-action-with-intel-realsense-technology

So you would do the following:

1.  Create a script file that contains the script for changing scene.

2.  Set up a SendMessageAction script and configure it to be connected to your scene changing script.

3.  Set SendMessageAction's "Event Source" to the 'Gesture Detected' setting and select the gesture 'Wave'.  The image I have linked to below shows this setup.

http://sambiglyon.org/sites/default/files/wave.jpg

If this does not work for you, let me know and I will talk you through another way of changing the scene with a wave.  Good luck!

0 Kudos
康夫_上_
Beginner
866 Views

Dear Marty G

Thank you very much for helping me each time.
I'm a programming beginner, so I'm very happy!

Thank you very much in a work procedure and a professor truth.
The script to which a game scene is changed is indicated on the following.

function OnTriggerEnter () {
 Application.LoadLevel ("my scene");
 }

After making a script above-mentioned, it's SendMessageAction.

0 Kudos
MartyG
Honored Contributor III
866 Views

You are very welcome.  I'm glad to be able to help.  :)

The way you are doing it looks correct.  Be sure that you put the game scene changing script in a JavaScript type script file and not a CSharp type script file or it will not work, as the programming is JavaScript code.  You select the script type by clicking on the menu beside the Language option on the script creation window.

http://sambiglyon.org/sites/default/files/wave2.jpg

 

0 Kudos
康夫_上_
Beginner
866 Views

Dear Marty G

Thank you very much!
If program inclusion was done right away, you could get inspection!
Thank you very ultra hyper super much very very unreasonably.
Because I'll also persevere in application development with future.
We'll also appreciate your continued support.

 

0 Kudos
MartyG
Honored Contributor III
866 Views

Thank you very much.  :)  I will do my best to provide continued support for your project!

どうもありがとうございました。:)私はあなたのプロジェクトのための継続的な支援を提供するために最善を尽くします!

0 Kudos
Reply