Babylon.js camera and input
Connects camera motion and selection to the player’s intended actions. It separates mouse, touch and interface input so aiming, dragging and clicking remain consistent inside the game canvas.
babylonjs-camera-input
See how it helpsWhen is it useful?
Use when a Babylon.js scene needs predictable controls during focus changes, resizing or interface interaction.
What does it help you do?
- Separates device events from gameplay commands and camera smoothing.
- Defines pointer capture, lock refusal and release behavior.
- Prevents interface clicks from also triggering actions in the scene.
Try asking this
In our 3D construction game, drag to rotate the camera and tap to select a building. Test a canvas beside a sidebar, touch input and a rejected pointer lock. Clicking the build menu must never place an object behind it.
Detailed documentation
Read the skill’s original instructions, examples and checks in their authored language.
Show less
Babylon.js — camera input
Use when implementing Babylon camera control, pointer picking, touch or controller interaction.
Version and project gate
Inspect package.json and lockfile, Babylon package family and exact version, engine creation, WebGL/WebGPU choice, canvas hosting, loaders, physics plugin version and asset ownership. Keep Babylon Lite and the full engine APIs distinct. Never turn a task into an engine upgrade without the user’s intent. Read the version-matching official reference when an API decision depends on it.
Work
Choose the camera behavior from the game’s movement contract. Separate raw device events from game actions, define pointer-lock and focus transitions, and translate canvas coordinates correctly. Keep interaction ray ownership separate from camera smoothing and UI hit testing.
Deliver
A control contract with capture/release behavior and one complete inspect/select/move interaction. Keep the change in the existing project structure; separate actual observations from the proposed acceptance scenario below.
Failure to prevent
Pointer lock can fail or be lost; transparent UI must not let a gameplay click act twice.
Acceptance scenario
Resize and rotate the viewport, lose focus during held movement, reject pointer lock and try touch selection over UI. Follow the project’s execution and verification permissions. If execution or a target device is unavailable, provide the reproduction steps and name the remaining uncertainty; do not mark it passed.
Scope and sources
This skill belongs to Ziva. Agent selection is restricted by Orqestria’s assigned-agent policy, including forced skill selection; instruction text alone is not an access control. These are original task workflows researched from official documentation, not a copied or endorsed vendor skill.
Included files 1
SKILL.md
