- 26
- 0
Вот прописал ему движения с помощью стрелок клавы но что-то не двигается персонаж
Код оставлю ниже помогите
C++:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class hero : MonoBehaviour {
Rigidbody2D rb;
void Start () {
rb = GetComponent<Rigidbody2D> ();
}
void Update () {
}
void FixedUpdate(){
rb.velocity = new Vector2(Input.GetAxis("Horizontal") * 12f, rb.velocity.y);
}
}
Последнее редактирование: