Mouse
This example shows a box following the mouse location within the game window.
Mouse location and clicks are logged in console.
engine.inputManager.mapInput('click', {
key: '0',
});
// In a system querying TMouseInputComponent:
if (engine.inputManager.wasActionJustPressed('click')) {
console.log(mouseInputComponent.mouseLocation?.clip);
}
if (mouseInputComponent.mouseLocation) {
mouseInputComponent.mouseLocation.clip,
);
transform.transform.translation = vec3.fromValues(loc[0], loc[1], -10);
}