VR gaze-based interaction in mobile app

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
VR gaze-based interaction in mobile app
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

VR Gaze Interaction in Mobile Apps

In mobile VR without controllers, gaze interface is the only way to interact with world. Seems simple: look at button, it activates. In practice, incorrectly implemented gaze frustrates user faster than any other UI pattern.

Gaze Raycast

Gaze is determined by camera view direction. Ray fires from camera position forward along Camera.main.transform.forward:

void FixedUpdate() {
    Ray gazeRay = new Ray(Camera.main.transform.position,
                          Camera.main.transform.forward);

    if (Physics.Raycast(gazeRay, out RaycastHit hit, maxGazeDistance, interactableLayer)) {
        var target = hit.collider.GetComponent<IGazeTarget>();
        if (target != null) {
            HandleGazeHit(target, hit.point);
        } else {
            HandleGazeMiss();
        }
    } else {
        HandleGazeMiss();
    }
}

FixedUpdate() instead of Update() — stable call frequency independent of FPS. On weak devices with 30 FPS dips, Update() gives uneven response.

interactableLayer — mandatory. Raycast across entire scene is expensive, and user shouldn't accidentally activate invisible colliders.

Reticle (Gaze Cursor)

Reticle is visual indicator of gaze point. Placed in world space on surface of object under gaze. Distance is dynamic: reticle "sticks" to hit point.

void UpdateReticle(Vector3 hitPoint, Vector3 hitNormal) {
    reticleTransform.position = hitPoint + hitNormal * RETICLE_OFFSET;
    reticleTransform.rotation = Quaternion.LookRotation(-hitNormal);

    // Constant scale in angular units (constant apparent size)
    float dist = Vector3.Distance(Camera.main.transform.position, hitPoint);
    reticleTransform.localScale = Vector3.one * dist * ANGULAR_SIZE;
}

When no object under gaze — reticle at default distance (3–5 meters). Don't hide it: user should always see where they're looking.

Dwell Activation and Progress Indicator

User looks at object for N seconds — activation happens. Optimal dwell time: 1.2–2.0 seconds. Less than 1 second — accidental activations during scene scan. More than 2 seconds — fatiguing.

Progress must be visible. Filling ring around reticle — standard:

public class GazeDwellController : MonoBehaviour {
    [SerializeField] private float dwellTime = 1.5f;
    [SerializeField] private Image progressRing;

    private float dwellProgress = 0f;
    private IGazeTarget currentTarget;
    private bool isActivated = false;

    public void OnGazeEnter(IGazeTarget target) {
        currentTarget = target;
        dwellProgress = 0f;
        isActivated = false;
        progressRing.gameObject.SetActive(true);
    }

    public void OnGazeStay() {
        if (isActivated) return;
        dwellProgress += Time.deltaTime / dwellTime;
        progressRing.fillAmount = dwellProgress;

        if (dwellProgress >= 1f) {
            isActivated = true;
            currentTarget?.OnGazeActivate();
            StartCoroutine(ResetAfterDelay(0.5f));
        }
    }

    public void OnGazeExit() {
        currentTarget = null;
        progressRing.gameObject.SetActive(false);
        dwellProgress = 0f;
    }
}

After activation — short cooldown before next activation of same object (0.5–1.0 sec). Otherwise user can't remove gaze in time and button "activates" twice.

Hover State: Feedback Before Activation

When user looks at object but dwell not complete, immediate visual feedback needed. Object should react on OnGazeEnter — before activation timeout. Options:

  • Highlight: change material emission color
  • Scale: object slightly enlarges (0.05f sufficient)
  • Animation: icon reacts to gaze
  • Sound signal: short click on dwell start

Without this user doesn't understand if app "sees" them.

Cardboard Button as Confirmation

Cardboard has physical button (magnetic trigger). Add it as alternative activation method instead of dwell — for advanced users faster and convenient:

// Cardboard SDK trigger event
void Update() {
    if (CardboardInput.GetButtonDown()) {
        TriggerCurrentGazeTarget();
    }
}

Button isn't dwell replacement, supplementary. Not all Cardboard housings have working magnetic button.

Common Implementation Mistakes

Too small collider on interactive object — user "misses" button. Collider should be 10–20% larger than visible object.

Activation triggers on any gaze pass over object — not only intentional fixation. Solved by minimum head angular velocity threshold at dwell start.

Reticle shakes from hand tremor — Cardboard SDK's gyro-fusion smooths this, but additional Lerp on reticle position (~20ms) removes residual shake.

Workflow

Analyze interactive elements: object types, interaction scenarios.

Implement raycast system with proper layers and colliders.

Reticle in world space with constant apparent size.

Dwell controller with progress indicator, hover state, cooldown.

Cardboard button as alternative trigger.

Test comfort: dwell time, button sizes, feedback.

Timeline Estimates

Basic gaze interaction system with reticle and dwell — 3–5 days. Full system with multiple interactive object types, animations, sound, configurable parameters — 1–2 weeks.