using System.Collections.Generic;
using UnityEngine;
public class PlayerCntrl : MonoBehaviour
{
public float speed = 20f;
private Rigidbody2D rb;
void Start()
{
rb = GetComponent <Rigidbody2D> ();
}
void Update()
{
float moveX = Input.GetAxis ("Horizontal");
rb.MovePosition (rb.positon + Vector2.right * moveX * speed * Time.deltaTime);
}
}
Вылазит ошибка:
All compiler errors have to be fixed before you can enter playmode! UnityEditor.SceneView:ShowCompileErrorNotification()
И ещё одна ошибка:
Assets\Scripts\PlayerCntrl.cs(17,29): error CS1061: 'Rigidbody2D' does not contain a definition for 'positon' and no accessible extension method 'positon' accepting a first argument of type 'Rigidbody2D' could be found (are you missing a using directive or an assembly reference?)
rb.positon
?