Skip to content

Instantly share code, notes, and snippets.

@lewa-j
Created February 1, 2015 10:59
Show Gist options
  • Save lewa-j/c4bbefdba7efcf3978c6 to your computer and use it in GitHub Desktop.
Save lewa-j/c4bbefdba7efcf3978c6 to your computer and use it in GitHub Desktop.
Move
void Move()
{
Vector3 newPos = transform.position;
float TmpMoveSens = PlayerMoveSens * Time.deltaTime;
newPos += (transform.forward*Input.GetAxis("Vertical")) * TmpMoveSens;
newPos += (transform.right*Input.GetAxis("Horizontal")) * TmpMoveSens;
// gravity
//newPos.y -= 3;
Vector3 Trace = GameManager.Ins.BSP.Move (transform.position, newPos, 0);
transform.position = Trace;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment