Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: KC1302 on January 07, 2016, 12:54:38 PM
-
http://vrmob.co/wp-content/uploads/2015/06/cardboard_io_2015.jpg
When I pull the trigger of my cardboard. I want to activate a action that allows me to send a event. Except I do not know which type of action I should use.
How can I tell my cardboard trigger to send a event?
Can someone clarify?
-
By "trigger" do you mean a button on the mobile device?
If so- you want to use the "get button down" action- you will need to figure out the button mappings for your device and use the correct button name in the action.
-
By trigger I mean the button / ring on the cardboard itself.
http://through-the-interface.typepad.com/.a/6a00d83452464869e201bb07e3ae5e970d-pi
I don't know if "get button down" action'' will be detected by my phone.
Has anyone here have experience with this?
-
Can you use 'any key' trigger?
-
I found this about Google Cardboard click:
http://www.andrewnoske.com/wiki/Unity_-_Detecting_Google_Cardboard_Click
With the first example you should be able to replace:
Debug.Log("DO SOMETHING HERE"); // PERFORM ACTION.
with:
PlayMakerFSM.BroadcastEvent("CardboardClick");
Then use "CardboardClick" events in your FSMs.
-
I found this about Google Cardboard click:
http://www.andrewnoske.com/wiki/Unity_-_Detecting_Google_Cardboard_Click
With the first example you should be able to replace:
Debug.Log("DO SOMETHING HERE"); // PERFORM ACTION.
with:
PlayMakerFSM.BroadcastEvent("CardboardClick");
Then use "CardboardClick" events in your FSMs.
Great! Thanks Alex :)
-
Hi, I'm after buying Playmaker specifically for a Google Cardboard project so being able to detect the magnet button pull is vital. But I also bought Playmaker because I can't code so... can you please expand on the above as my eyes were glazing over slightly :-)
Which script do I require exactly and what exactly do I do with it to be able to detect a pull on the Cardboard magnet button? Thanks in advance.
-
Actually doing a little more research, it seems like the Cardboard SDK for Unity makes this a lot simpler.
If you're using the Carboard SDK for Unity the attached file should broadcast an event when the trigger is pressed.
I found this article useful:
http://www.raywenderlich.com/116805/make-vr-game-unity-google-cardboard