Выдает ошибку в Unity
Вот такую ошибку выдает Юнити что делать
Assets\PlayerMovement.cs(44,12): error CS1061: 'Rigidbody' does not contain a definition for 'AddForse' and no accessible extension method 'AddForse' accepting a first argument of type 'Rigidbody' could be found (are you missing a using directive or an assembly reference?)
Мой код:
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public Rigidbody rb;
public float runSpeed = 500f;
public float strafeSpeed = 500f;
public float jumpForse = 15f;
protected bool strafeLeft = false;
protected bool strafeRight = false;
protected bool doJump = false;
void Update()
{
if (Input.GetKey("a"))
{
strafeLeft = true;
} else
{
strafeLeft = false;
}
if (Input.GetKey("d"))
{
strafeRight = true;
} else
{
strafeRight = false;
}
if (Input.GetKeyDown("space"))
{
doJump = true;
} else
{
doJump = false;
}
}
void FixedUpdate()
{
rb.AddForse(0, 0, runSpeed * Time.deltaTime); //Тут ошибка
}
}
Ответы (1 шт):
Автор решения: SoulOFTrue
→ Ссылка
Замените
rb.AddForse(0, 0, runSpeed * Time.deltaTime);
на
rb.AddForсe(0, 0, runSpeed * Time.deltaTime);
