Created
September 7, 2021 01:05
-
-
Save curious-username/de3b77239bda8d6b15023010080fc3b9 to your computer and use it in GitHub Desktop.
showing example of player control in Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public float speed = 5.0f; // Global variable | |
float horizontalInput = Input.GetAxis("Horizontal"); | |
float verticalInput = Input.GetAxis("Vertical"); | |
transform.Translate(Vector3.right * horizontalInput * speed * Time.deltaTime); | |
transform.Translate(Vector3.up * verticalInput * speed * Time.deltaTime); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment