I am new to unity and VR. I have been using google cardboard SDK to create VR apps in unity and am stuck at gazetimer. I want to trigger an action only if the user looks at any object for 3secs but have not been able to do so. Please help
how to add gaze input timer to trigger an action after gazing for 3secs?
5.7k views Asked by sayal adhikari At
2
There are 2 answers
0
Eugene Sia
On
Please see a similar question and answer here Use Gaze Input duration to select UI text in Google Cardboard
In summary, create a script to time the gaze, by cumulatively adding Time.deltaTime on each frame when the object is gazed at. When gaze time hits a pre-specified duration, trigger the button's OnClick event.
On the object, activate the script's gaze timing functions using event triggers Pointer Enter and Pointer Exit. See screenshot:
Related Questions in UNITY-GAME-ENGINE
- How to use invokerepeating and make ui text fade in/out over time?
- Player input not working properly in unity
- Get block in Mesh Unity
- Does Unity render invisible material?
- Physics.OverlapSphere couldn't detect my ‘Player’
- Cannot sync non-player objects in Unity mirror
- How to script a simple collision using hands in OVRCameraRigInteraction?
- Drawing on 3D object at Unity
- How to Override Spline Rotation for Player-Controlled Car in Racing Game?
- Why doesn't my enemy shield take damage first. Instead both enemy and shield are being destroyed together
- unity + Vuforia balck screen in android AR app
- how do I change an objects tag when the game closes
- How to remove white space in a user's input through an input field in Unity?
- Timeline doesn't start eventhough it recognises the trigger input
- Ragdoll 2D Aiming
Related Questions in UNITYSCRIPT
- Get block in Mesh Unity
- Drawing on 3D object at Unity
- How to add Undo Button Functionality?
- Unity2D: I Can't do a WallJump
- How can i make the attack state of my FSM work?/ Unity
- How to create a proper jumping and doublejumping system for 2.5D platformer on Unity?
- Unity 2D - animated background
- Inputfield not showing the dropdown on end edit
- how to receive streaming response in Unity C#?
- Could I use multiple materials in Skybox?
- Add TextMeshPro component to gameobject
- XR Interaction Toolkit: How do detect if my player is standing on a object?
- One player controls the other unity photon
- Animation not transitioning Unity
- Can't attach animation after creating one through script in Unity
Related Questions in GOOGLE-CARDBOARD
- Using a typical mobile screen on the Unity Google Cardboard
- Google cardboard VR closing the whole application after pressing switching VR off button
- Upgrade from Google VR to Google Cardboard XR Plugin…limiting reticle distance and using event triggers component in editor
- Google cardboard qr code scanner, not scanning on third party apps
- Convert AR mobile application to VR
- google cardboard in unity 2019.4
- Create an aar from an android project that uses Google carboard sdk
- How to change the position of two screens in GoogleCardboardVR on Unity
- Interact with unity UI elements (canvas) in Cardboard VR
- HelloCardboard (Unity) - My camera doesn't move
- Unity VR Game Build Hiccup,Unity VR Game Hiccup
- It's posible to create an AR app using google cardboard?
- Unity 'android.enableR8=false' is deprecated
- How to add a 360 video with Google Cardboard support to my Flutter app
- Gradle Build Failed - Trying to run HelloCardboard on Android, Unity 2021.3.18f1
Related Questions in VIRTUAL-REALITY
- I want to rotate WebXR Rectile towards walls
- Looking to access wide angle camera of smartphone while making an AR application using Vuforia
- Quest 3 device technical feasibility
- issue with random input latency on quest 3
- can't to save oculus spatial anchors (on cloud or locally)
- AR Plane Detection using Oculus Integration Unity SDK
- Voice SDK does not work on the Quest but does in Unity editor
- Meta Quest2/3 Unity SDK - How to get battery level info
- How drag and drop 2D UI elements of Canvas in OVR ray interactable?
- How to Drag Image on Canvas with Meta All-in-One SDK
- Ray interactor can't select a 3d Object
- Animating Entity in VisionOS based on mouse gesture?
- Time warping analysis from HMD's Data-Log
- The Pico unity openxr sdk is incompatible with openxr 1.9.1, but I can't downgrade the openxr version in the editor
- Delay in Passthrough Camera Feed in Unity Quest 3
Related Questions in 360-VIRTUAL-REALITY
- How to use rvt file in HTML page to preview 360 virtual tour?
- How to make an A-Frame 360 3D Gallery for VR?
- How to rotate/move 360 spherical video in ExoPlayer in Android TV by using D-pad
- google cardboard in unity 2019.4
- Modify class SphericalGLSurfaceview
- 360 video not playing on aframe
- Build an Stereoscopic player in Android with Exoplayer
- Is there any way to create 360 Video or 360 Image Player using Cardbord sdk?
- How to create 360 degree view panorama from multiple images using javascript and display it on the website for the user
- Alternative for VrPanoramaView since it is deprecated
- Unity VR game being blurry/shaky on Oculus Rift
- How to develop free viewpoint video from 5 azure kinect and play on Meta Quest 2
- Playing 360 degree split screen videos with ExoPlayer
- 360 video embed on iOS
- Why is A-Frame WebVR not working the same on mobile as desktop?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)

VR Camera usually contains a main camera and eye cameras (right and left). Since Main camera's center point will always be the center of the eyes of the user's point of view, you could use
Raycastfrom itstransform.positionto itstransform.forwardand check whether it hits your object. Then simply add a timer which will call the action after it reaches the duration you have set.For example:
Hope you get the idea.