Skip to content

Conversation

@SauravGupta123
Copy link
Contributor

@SauravGupta123 SauravGupta123 commented Apr 20, 2025

Description

In the previous implementation, the Robot's head only moved when the mouse was inside the Spline canvas.
This has now been fixed — the robot's head and neck can track the mouse movement across the entire viewport, improving interactivity and user experience.

Changes:

  1. Implemented global mouse tracking using event listeners on the document to capture cursor movement outside the Spline canvas.

  2. Added references to the robot’s head and neck objects in the scene to dynamically rotate them based on mouse position.

  3. Separated the Robot component into a client-side component using useRef and useEffect, ensuring compatibility with Spline and React’s client-only hooks.

Fixes: #186

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant