Как решить эту проблему?
код:
void FixedUpdate()
{
if (UnityEngine.Input.GetKey(KeyCode.W))
{
GameObject.transform.position = new Vector2(GameObject.transform.position.x,
y: GameObject.transform.position.y + 1.79f);
}
if (UnityEngine.Input.GetKey(KeyCode.S))
{
GameObject.transform.position = new Vector2(GameObject.transform.position.x,
y:GameObject.transform.position.y - 1.79f);
}
if (UnityEngine.Input.GetKey(KeyCode.A))
{
GameObject.transform.position = new Vector2(x:GameObject.transform.position.x + 1.79f,
GameObject.transform.position.y);
}
if (UnityEngine.Input.GetKey(KeyCode.D))
{
GameObject.transform.position = new Vector2(x:GameObject.transform.position.x - 1.79f,
GameObject.transform.position.y + 1.79f);
}
}