playMaker

Author Topic: Cardboard GazeInput Replacement No Scripting Needed  (Read 4618 times)

TellMeTellMeDontTellMe

  • Playmaker Newbie
  • *
  • Posts: 9
Cardboard GazeInput Replacement No Scripting Needed
« on: February 26, 2016, 12:26:14 PM »
Okay, so, okay, I'm posting this because I spent the last day googling "playmaker raycaster", "playmaker cardboard gazeInput", "playmaker event manager", and not finding what I needed. I hope to spare someone else that fate.

For my current gig it's necessary to avoid all scripting, so I was pulling my hair out trying to use standard PlayMaker actions to inspect Cardboard's GazeInput Module. This is the official way to make Cardboard detect whatever the user is currently looking at. It involves InputModules and EventManagers and Raycasters and custom-scripted Event responses... ugh. I was taking each of those and fussing with "Get Property", "Get Component," and even "Call Method", etc, etc all day, trying to find what I needed.

I'm here to say that, as usual with Playmaker it is SO EASY.

Here's all you need:

1. Whatever object you wish to turn into a gaze trigger, make sure it has a Collider component. Note that you *don't* have to check "IsTrigger"--it will work anyway.
2. Attach Playmaker's Raycast action to an FSM in the MainCamera inside Cardboard's Head object.
3. On the Raycast action, set Direction to X: 0, y: 0, Z: 1. This makes the raycast always aim directly forward from the Main Camera.
4. Set the Hit Object and Hit Event to any variables you like, and you're done!

Man oh man, all that complicated GazeInput was stuff duplicated with ONE Playmaker action. I wish I'd found it before wrestling with the official process for so long. But I hope this post helps anyone else in my position!

p.s. Cardboard is cool. :)

Easound

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Cardboard GazeInput Replacement No Scripting Needed
« Reply #1 on: March 08, 2016, 03:21:20 PM »
 Thanks for the tip. I also found this which works really well.

andycoke

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Cardboard GazeInput #Replacement No Scripting Needed
« Reply #2 on: March 18, 2016, 11:32:37 AM »
@TellMeTellMeDontTellMe thanks for the post, I am trying to do this and I am running into problems.

Following your steps:

1. Clear
2. Clear
3. Clear
4. This is where I am going wrong.

In a really simple example, I have a cube and I have used Playmaker to set up 2 states. Using Set Material colour, mouseEnter is red, mouseExit is black. This works fine pre Cardboard. After Steps 1-3, what do I need to do to make this work with Gaze alone and Gaze with click?

Much appreciated if you can help.
« Last Edit: September 28, 2017, 05:19:28 AM by andycoke »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Cardboard GazeInput Replacement No Scripting Needed
« Reply #3 on: March 18, 2016, 02:25:51 PM »
Hi,
Could you repost this into the Playmaker Tips & Tricks section :)

OddButAwesome

  • Playmaker Newbie
  • *
  • Posts: 49
    • Odd but Awesome Apps on Playstore
Re: Cardboard GazeInput Replacement No Scripting Needed
« Reply #4 on: March 23, 2016, 07:04:14 PM »
Hi there,

I am working on a Cardboard Experience ( *cough* roller coaster *cough* ) ;D

I have a working menu with 1 button and the screen shots show my method. I hope this helps. It is a compilation of bits I have found googling tutes etc. The active/animated button material is an 'Unlit / Transparent Cutout' with a TIF with alpha cutoff as the countdown indicator.

Continuing with this tho... I am adding a second button (exit app). The 1 button works well enough, as the logic has the bool 'gaze hit or not'. Something weird is happening here. Gazing at the Begin works as before. The gazing at the Exit appears to work on my PC in Unity testing. But when testing on my phone neither button activates at all. Anyways.... this is WIP and I will find the answer soon.

Best of luck
J

OddButAwesome

  • Playmaker Newbie
  • *
  • Posts: 49
    • Odd but Awesome Apps on Playstore
Re: Cardboard GazeInput Replacement No Scripting Needed
« Reply #5 on: March 23, 2016, 07:05:08 PM »
Second part for remaining screen caps (6 total).

I am still learning and would love to learn how to make this better so if anyone has ideas please let me know.
« Last Edit: March 23, 2016, 07:16:19 PM by OddButAwesome »

andycoke

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Cardboard GazeInput Replacement No Scripting Needed
« Reply #6 on: March 24, 2016, 10:32:18 AM »
Thanks for the post J, I managed to work it out in the end.

If anyone is stuck on this in the future, this worked for me...


« Last Edit: March 24, 2016, 11:16:55 AM by andycoke »

TellMeTellMeDontTellMe

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Cardboard GazeInput Replacement No Scripting Needed
« Reply #7 on: April 26, 2016, 09:07:56 AM »
Hi @andycoke, sorry I didn't get back to you immediately--I'm not in the habit of checking these forums yet.

I'm glad you found a method that works for you though!

Since I've been asked to repost this in tips & tricks, I wonder if you could tell me how to modify my description of step 4 so that it addresses the problem you were having.