Created
April 18, 2021 05:52
-
-
Save GT3000/671261e6ae27964e1720507261002014 to your computer and use it in GitHub Desktop.
Simple 3D movement for a sphere
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 class Player : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
Vector3 playerPos = new Vector3(-Input.GetAxisRaw("Vertical"),0 , Input.GetAxisRaw("Horizontal")); | |
GetComponent<Rigidbody>().velocity = playerPos * Time.deltaTime * 100.0f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment