Skip to content

Instantly share code, notes, and snippets.

@curious-username
Last active June 12, 2022 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curious-username/541a4788927397b274d08bbb866aa88b to your computer and use it in GitHub Desktop.
Save curious-username/541a4788927397b274d08bbb866aa88b to your computer and use it in GitHub Desktop.
if (Input.GetKeyDown(KeyCode.A))
{
Debug.Log("Adding v2: " + _greenCube.transform.position);
_greenCube.transform.position += v2;
}
else if (Input.GetKeyDown(KeyCode.S))
{
Debug.Log("Subtracting v2: " + _greenCube.transform.position);
_greenCube.transform.position -= v2;
}
else if (Input.GetKeyDown(KeyCode.D))
{
v2 /= 2;
Debug.Log("Dividing V2 by 2:" + v2);
_greenCube.transform.position = v2;
}
else if (Input.GetKeyDown(KeyCode.M))
{
v2 *= 2;
Debug.Log("Multipling V2 by 2" + v2);
_greenCube.transform.position = v2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment