Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created July 22, 2015 15:59
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 tsubaki/062aec1180d7b820fc16 to your computer and use it in GitHub Desktop.
Save tsubaki/062aec1180d7b820fc16 to your computer and use it in GitHub Desktop.
カメラの向きを元にキャラクターの移動先を決定する
var cameraForward = Vector3.Scale(Camera.main.transform.forward, new Vector3(1, 0, 1)).normalized;
Vector3 direction = cameraForward * Input.GetAxis ("Vertical") +
Camera.main.transform.right * Input.GetAxis ("Horizontal");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment