Hello!
I’ve just started out with AwayPhysics and I’m stuck with a probably simple problem. I want to make a simple cylinder rigid body move with my arrow keys, preferably by applying forces in a correct way.
I’m rotating the cylinder like so:
/*When right key is held */
_playerRotation += 3
_playerBody.rotation = new Vector3D(0, _playerRotation, 0);
I apply force to move my cylinder forward like:
/* When forward key is held */
_playerBody.applyCentralForce(new Vector3D(0, 0, 20));
The issue is that when the force is applied it simply moves in the Z-axis of the world, I want it to be pushed in the local rotation direction of the cylinder! How would I go about making this happen?
Thanks!