2D персонаж не двигается. Консоль не показывает ошибокC#

Место общения программистов C#
Anonymous
2D персонаж не двигается. Консоль не показывает ошибок

Сообщение Anonymous »

Я не смог найти ошибок в этом коде. если в коде нет ошибок, сообщите мне, в чем дело.
```
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{

public float speed = 5;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");

Vector2 pos = transform.position;

pos.x += h * Time.deltaTime;
pos.y += v * Time.deltaTime;

transform.position = pos;
}

} // class

```

Вернуться в «C#»