playMaker

Author Topic: Google Cardboard Trigger event  (Read 6082 times)

KC1302

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Google Cardboard Trigger event
« on: January 07, 2016, 10:54:38 AM »
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?


mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: Google Cardboard Trigger event
« Reply #1 on: January 07, 2016, 04:40:24 PM »
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.
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

KC1302

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Google Cardboard Trigger event
« Reply #2 on: January 07, 2016, 07:35:21 PM »
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?

basuki

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Google Cardboard Trigger event
« Reply #3 on: February 11, 2016, 02:34:52 PM »
Can you use 'any key' trigger?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3639
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Google Cardboard Trigger event
« Reply #4 on: February 11, 2016, 02:44:21 PM »
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:
Code: [Select]
Debug.Log("DO SOMETHING HERE");  // PERFORM ACTION.
with:
Code: [Select]
PlayMakerFSM.BroadcastEvent("CardboardClick");
Then use "CardboardClick" events in your FSMs.
« Last Edit: February 11, 2016, 02:45:59 PM by Alex Chouls »

basuki

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Google Cardboard Trigger event
« Reply #5 on: February 11, 2016, 07:37:22 PM »
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:
Code: [Select]
Debug.Log("DO SOMETHING HERE");  // PERFORM ACTION.
with:
Code: [Select]
PlayMakerFSM.BroadcastEvent("CardboardClick");
Then use "CardboardClick" events in your FSMs.

Great! Thanks Alex :)

Simvirtua

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Google Cardboard Trigger event
« Reply #6 on: February 15, 2016, 12:26:33 PM »
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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3639
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Google Cardboard Trigger event
« Reply #7 on: February 16, 2016, 01:05:35 AM »
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