Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- public class Navigator : MonoBehaviour {
- void Start () {
- }
- void Update () {
- if(Input.GetKeyDown(KeyCode.W)){
- transform.Translate(new Vector3(0,1,0));
- }
- if(Input.GetKeyDown(KeyCode.S)){
- transform.Translate(new Vector3(0,-1,0));
- }
- if(Input.GetKeyDown(KeyCode.A)){
- transform.Translate(new Vector3(-1,0,0));
- }
- if(Input.GetKeyDown(KeyCode.D)){
- transform.Translate(new Vector3(1,0,0));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement