// Point to mouse
float dX = Gdx.input.getX() - position.x;
float dY = Gdx.input.getY() - position.y;
direction = (float) Math.atan2(dY, dX);
direction = (float) Math.toDegrees(direction);
How do I fix my math?
// Point to mouse
float dX = Gdx.input.getX() - position.x;
float dY = Gdx.input.getY() - position.y;
direction = (float) Math.atan2(dY, dX);
direction = (float) Math.toDegrees(direction);
How do I fix my math?