I was searching for a proper and simple way to freeze rotation just like Unity does and after nothing that I tried worked I ended up with that @Cedricsolution, but the thing is that we do not have anything like it on the docs, at least I didn’t found it.
Since this is something really important for games in general and it is somewhat hard to find it could be added to the main API of the babylonjs!
I would like to know your thoughts about it also btw, this is motivate because if you add a simple cube on a plane, add a phisical “jump” to that cube, if you jump a couple of times the cube starts to rotate cause of its colision on the floor and I think this isnt the expected behavior of the most of the cases.
It’ll also be good to allow us to touch it withing typescript since we got the error that we should not access private properties.
No I didn’t, but lmk if I’m wrong, that kind of approach that re-set something each frame isn’t like a work around instead of a proper solution? I mean, it sounds way better to me to kind of make the object hard to rotate other than re-set its rotation every frame.
Like, reset the rotation every frame using quaternions or linearVelocity, to a dummy in this subject like me, seems like almost the same thing, just changing the way we reset it. It isnt?
Hey @Cedric I’m really sorry for the late answer, I completelly miss that ;-;
Just read it here and the tests worked pretty fine, also not throwing a error on typescript, Im just curious now of what is the difference between setAngularFactor on physicsBody and physicsImpostor? Do you know why it behave differently?