Skip to content

Fix camera interaction bug#6550

Open
HussainAther wants to merge 6 commits intoHubs-Foundation:addonsfrom
HussainAther:fix-camera-interaction-bug
Open

Fix camera interaction bug#6550
HussainAther wants to merge 6 commits intoHubs-Foundation:addonsfrom
HussainAther:fix-camera-interaction-bug

Conversation

@HussainAther
Copy link

What?

This PR adds a stabilize-camera component that enforces network authority when interacting with a spawned camera. It prevents erratic camera rotation caused by multiple clients trying to manipulate the same object simultaneously.


Why?

Fixes [#6544](#6544)

When one user spawns a camera and another attempts to grab or rotate it, the camera currently enters a fight between local and remote transform updates—resulting in jittery or looping motion. This change ensures that only the owning client can perform such interactions.


Examples

A user without ownership attempting to interact with another's camera will now:

  • See a warning message in the console
  • Be prevented from causing movement/rotation

camera-fix
Mock-up of expected behavior


How to test

  1. User A joins a room and spawns a camera.
  2. User B joins and attempts to grab or rotate that camera.
  3. Confirm that User B’s interaction is blocked, and the camera stays stable.
  4. User A should still be able to manipulate their own camera normally.

Documentation of functionality

No new user-facing documentation is needed. Internal component code is self-documented with inline comments.


Limitations

  • This fix applies only to camera objects with networked ownership. Other interactive objects might still need similar authority checks.
  • Does not apply advanced physics rollback for conflicting grabs (low priority edge case).

Alternatives considered

  • Disabling camera interaction globally: Too aggressive and removes user agency.
  • Adding delay-based conflict resolution: Adds unnecessary complexity for minimal gain.

Open questions

  • Should we expand this stabilize-camera behavior to other sensitive networked objects (e.g., avatars or streaming devices)?
  • Is there a preferred way to expose grab ownership feedback to the user (beyond console warnings)?

Additional details or related context

  • Component uses NAF.utils.isMine() to determine local ownership.
  • Tags reviewers for feedback and testing.

cc: @bitbengames @DougReeder
Feel free to suggest refinements or expand the logic to additional object types.

@HussainAther
Copy link
Author

  • Removed reference to addons.json and related dynamic entry config for hub
  • Removed unused alias for hubs.js
  • Replaced manual optimization block with standard runtimeChunk setting
  • Cleaned up duplicate keys and improved clarity
@DougReeder DougReeder changed the base branch from master to addons June 4, 2025 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants