playMaker

Author Topic: Gaze Timer  (Read 2941 times)

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #15 on: March 17, 2017, 02:03:30 AM »


This is a screenshot with the game view. The red dot is vissible, I look at the button, but nothing happens.

I don't get any more errors. I updated the Gaze thingie, but it only downloads the files I am missing, so I deleted the RectTransformWorldToScreenPoint.cs which had the error 2 days ago... I updated... so this new .cs file got downloaded. No more errors.

But I'm thinking that maybe 2 days ago you modified other files that havnt' been updated on my PC.



Is there any way to fast delete those files so I can re-download the package? This is one of the things I hate in Unity. You can't Uninstall Assets fast :)

Anyway, I deleted the majority of Gaze files. Did a reimport ... same thing.

Here, I even made a video:
https://streamable.com/zy2gd
Technical Game Designer
www.GamerPET.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Gaze Timer
« Reply #16 on: March 20, 2017, 02:09:58 AM »
Hi,

apart from this missing file, all seems ok. Something is very wrong here.

which version of the Oculus do you have?

 Bye,

 Jean

 

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #17 on: March 20, 2017, 02:19:56 AM »
I have the consumer version of Oculus.
Technical Game Designer
www.GamerPET.com

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #18 on: March 20, 2017, 02:14:26 PM »
Hello Jean,

I just tested this at home. Same project... but no occulus. It works fine!!!

Is there a way to debug the raycast? I'm curious to see how it's being drawn.
Technical Game Designer
www.GamerPET.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Gaze Timer
« Reply #19 on: March 20, 2017, 11:16:40 PM »
Hi,

 yeah, odd. So it's either the Canvas and graphic raycaster that is not setup properly to work with the oculus, or the wway the oculus control the camera makes raycasting faulty somewhere along the line, at least with the technic used.

and indeed, doing some researched leads me to this:

https://forum.unity3d.com/threads/unity-5-2-vr-raycast-solved.361211/

 Where it seems we can't use any default camera orientation for some reason.

 I also found this: https://forums.oculus.com/developer/discussion/16710/new-unity-ui-ovr-look-based-input-howto

can you try this component and follow the instructions? it that works, then great.

Let me know how it goes.

 Bye,

 Jean


PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #20 on: March 21, 2017, 04:29:24 AM »
That's a pretty old post from the Oculus forums. 2014.

Btw. I had a project last year where I used OnMouseOver action. SOmething like that. The cursor was always in the middle hidden, so it made sense to use it. No Raycast used.

However in VR this didn't worked because the Oculus Camera overwites the movement. Meaning... even that I move left/right/up/down with my head, the cursor still remained in the "center of a screen".

Makes sense?
Technical Game Designer
www.GamerPET.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Gaze Timer
« Reply #21 on: March 21, 2017, 10:43:37 PM »
Hi,

 I would nonetheless give it a go. I haven't found anything better on paper when googling for this.

 Bye,

 Jean

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #22 on: March 22, 2017, 02:16:38 AM »
I will look into that project... but from what I see... it's for Unity 4.
I see that there are some pages there. Some guy says this:



Btw. As a test, I decided to place a Raycast on the camera. It looks like this:


So the raycast can be casted correctly. Can't we just use a normal raycast and check when we hit the UI buttons? The UI buttons are in world space anyway and they can have a colider.
« Last Edit: March 22, 2017, 03:30:45 AM by PET »
Technical Game Designer
www.GamerPET.com

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #23 on: March 22, 2017, 03:37:43 AM »
Hey Jean. Have a look at this:

https://streamable.com/jgokx


:))

The whole thing is not 100% precise... like I have to look a little bit down in order to trigger the button.

https://streamable.com/hwoga
« Last Edit: March 22, 2017, 03:40:02 AM by PET »
Technical Game Designer
www.GamerPET.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Gaze Timer
« Reply #24 on: March 22, 2017, 07:05:34 AM »
Hi,

 Yes, and actually, if you updated uGui from the proxy, you have a new component that matches colliders to the Ui element, so it will be a lot more convenient now. More infos below:

https://twitter.com/JeanAtPlayMaker/status/842327318441910273

 I think it's a hack, and I would recommand searching for the real source of the problem, but of course if raycasting works ( though it's odd it's offseted...)

 I would ask the community on how they do it, because I am using straight Unity api within the actions and they should work, if it's not working here, I think everyone is facing this...

you could try this too as well: https://github.com/polats/gvr-unity-sdk/blob/master/Samples/CastleDefense/Assets/OVRInspector/Scripts/OVRRaycaster.cs


 Bye,

 Jean

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #25 on: March 22, 2017, 07:11:54 AM »
Well I don't have to use a Raycast. The problem was the Mouse Look from the Camera orbit FSM.



If I disable this, I can Gaze the UI buttons using Oculus! Ofc, as you said, it's a bit offset, but I will use your new small script.
Technical Game Designer
www.GamerPET.com

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #26 on: March 23, 2017, 08:19:03 AM »


Am I not adding the Box Collider 2d Match Rect Transform correctly?
I have added it to the Button A & B which contains the Image (Script).

It does add that collier ... however the colider is not rotated corectly ... the camera raycast is still a little bit offset.

Not a huge deal... I can still use this... I'm just curious on how to do this correctly.

Thanks
Technical Game Designer
www.GamerPET.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Gaze Timer
« Reply #27 on: March 23, 2017, 11:20:33 PM »
Hi,

 ah crap yes, it only works on overlay settings...

I'll do a 3d physics version of this component, that should fix it. Please ping me early next week if I haven't done it yet.


 Bye,

 Jean

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #28 on: March 27, 2017, 07:12:12 AM »
did a small test with that scene on GearVR. button work but the problem is that small dot. in editor the red dot works but in gearvr it doesn't show up. it was the same in my oculus PC build test.

--------

The only way to see the Red dot is to set up the Canvas to "Screen Space - Camera". But of course, that is not going to trigger the buttons anymore :(
« Last Edit: March 28, 2017, 04:48:02 AM by PET »
Technical Game Designer
www.GamerPET.com

PET

  • Full Member
  • ***
  • Posts: 136
    • View Profile
    • GamerPET
Re: Gaze Timer
« Reply #29 on: March 28, 2017, 10:51:33 PM »
Ok. I fixed the RED DOT problem... by making another Canvas that was set up to Screen Space - Camera!

The game window looks like this:


So... turns out ... that the default gaze was not in the center of the screen... which is why it was the whole button was offsetting. LOL

So, with that new Gaze... I can see a red dot on the Oculus... and the triggering works fine :))


I still find this whole process a bit MEH.

I feel that we require way to many things. Playmaker UGui, then you need those 2 scripts:


Then you need the buttons logic, then the gaze logic, etc.

Well I understand part of the logic... I just don't understand why we also need to have the above 2 scripts.

Look ... a video:
https://streamable.com/o80mp
« Last Edit: March 28, 2017, 10:55:30 PM by PET »
Technical Game Designer
www.GamerPET.com