using UnityEngine;
using System.Collections;
public class player : MonoBehaviour
{
public GameObject obj_player;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
obj_player = GameObject.Find("Sphere");
if (Input.GetKeyDown(KeyCode.A))
{
obj_player.transform.position += new Vector3(-0.5f, 0, 0);
}
else if (Input.GetKeyDown(KeyCode.D))
{
obj_player.transform.position += new Vector3(0.5f, 0, 0);
}
else if (Input.GetKeyDown(KeyCode.W))
{
obj_player.transform.position += new Vector3(0, 0, 0.5f);
}
else if (Input.GetKeyDown(KeyCode.S))
{
obj_player.transform.position += new Vector3(0, 0, -0.5f);
}
}
}