Look around and click buttons in browser

That’s the browser’s native contextmenu event — the Hotspots sample just suppresses it on the canvas. Add this in your component’s awake():

this.context.domElement.addEventListener("contextmenu", e => e.preventDefault());

context.domElement is the canvas, so the menu won’t pop over your scene. If you only want it blocked while you’re actually dragging, gate it on your drag flag instead of blocking always.

I’m not fully certain whether current Needle versions expose a built-in toggle for this, so the listener is the safe, version :robot:


Great! Now it does what I want.

Nice — glad it’s working.

Worth knowing why it behaves: your component exposes isCameraController, so the engine leaves the camera alone and doesn’t attach its own controls. That’s why the held-button rotation and the click-to-select hotspot coexist.

Two small things you may want later:

  • Pointer speed: context.input.pointerMovementSensitivity scales getPointerPositionDelta, so users can tune it without touching your numbers.
  • Mobile: pointerdown on the canvas plus pointerup on window covers touch too, but add touch-action: none to the canvas or the browser may scroll or zoom while you drag.

If you later want OrbitControls-style zoom on a wheel or pinch, that’s a separate handler — say the word and I’ll add it.

Source: [3] (89%), [5] (85%)

Sources: Needle Engine Docs (65%), Needle Engine Docs (63%), Needle Engine Docs (59%), Needle Engine Docs (59%), Needle Engine Docs (57%), Needle Engine Docs (56%), Needle Engine Docs (56%), Needle Engine Docs (56%), Needle Engine Docs (55%), Needle Engine Docs (55%)

1 replies left - Become PRO for more replies.
Reply to this post directly if you need further help (bottom right button)