by user 191204280198234122
here you can see just with
document.body.requestPointerLock();
and
window.onmousemove = (e) => {
const x = e.movementX;
const y = e.movementY;
this.gameObject.rotation.y += x * 0.002;
}
by user 191204280198234122
now i upload with this :
window.onmousemove = (e) => {
const x = e.movementX;
const y = e.movementY;
this.gameObject.rotateY(x * 0.001);
this.gameObject.rotateX(y * 0.001);
console.log(this.gameObject.rotation.x);
}
by user 191204280198234122
by user 191204280198234122
by user 191204280198234122
Sorry for the late reply. Could you maybe try to rephrase your question? Im not sure if I understand correctly what you are trying to do
No problem youāre helping me perfectly.
Okay.
Actually I want to make a 3d world with movement and collisions
by user 191204280198234122
But for now I canāt lock rotation (you can see photo), I can return world⦠in unity I can lock this just with a checkbox but idk how can I do this in JavaScriptā¦
by user 191204280198234122
The first onmousemove is for move in all direction, but if I make circle with mouse the world can be returned (like first video)
by user 191204280198234122
The second is without but I can just move at right and left
by user 191204280198234122
Which checkbox are you using on unity?
With lock one axis on camera (we can lock X Y or Z)
by user 191204280198234122
But I canāt use this with needle
by user 191204280198234122
You mean on the rigidbody?
Yeah exactly
by user 191204280198234122
In Constraints
by user 191204280198234122
That was added in the last update actually
Maybe it helps
Oh !!
by user 191204280198234122
I can add rigid body on my camera ?
by user 191204280198234122