Skip to content

Instantly share code, notes, and snippets.

@stisa
Last active August 29, 2015 14:15
Show Gist options
  • Save stisa/d4f985c26fedcca8d6fa to your computer and use it in GitHub Desktop.
Save stisa/d4f985c26fedcca8d6fa to your computer and use it in GitHub Desktop.
Libgdx unproject

Use camera.unproject(vector3)

vector3 is:

x = Gdx.input.getX();
y = Gdx.input.getY();
z=0;
Vector3 vector3 = new Vector3 (x,y,z);

Pass this vector in camera.unproject(vector3).

Use x and y of this vector to draw your character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment