Mail.ruПочтаМой МирОдноклассникиВКонтактеИгрыЗнакомстваНовостиКалендарьОблакоЗаметкиВсе проекты

Помогите с ошибкой юнити

dhddh djkfdgjhj Ученик (47), на голосовании 5 месяцев назад
Assets\Scripts\Player.cs(8,5): error CS0246: The type or namespace name 'SerializeFiled' could not be found (are you missing a using directive or an assembly reference?)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{

[SerializeFiled] private float movingSpeed = 10f;

private Rigidbody2D rb;

private void Awake() {
rb = GetComponent<Rigidbody2D>();

if (rb == null) {
Debug.LogError("Rigidbody2D не найден на объекте Player");
}
}

private void FixedUpdate() {
if (rb == null) return;

Vector2 inputVector = new Vector2(0, 0);

if (Input.GetKey(KeyCode.W)) {
inputVector.y = 1f;
}

if (Input.GetKey(KeyCode.S)) {
inputVector.y = -1f;
}

if (Input.GetKey(KeyCode.A)) {
inputVector.x = -1f; // Исправлено направление движения по оси X
}

if (Input.GetKey(KeyCode.D)) {
inputVector.x = 1f;
}

rb.MovePosition(rb.position + inputVector * (movingSpeed * Time.fixedDeltaTime));
}
}
 помогите решить ошибку 
Голосование за лучший ответ
ياكاروتشيتاكا اليابان Ученик (244) 6 месяцев назад
хмм данный код не очень сложный ща разберусь
Игорь Ступинский Мыслитель (5834) 6 месяцев назад
В сообщении написано, что пространства имен SerializeField не существует, но вы почему-то используете его для объявления переменной movingSpeed. Удалите [SerializeField]
S.H.I. Оракул (71319) 6 месяцев назад
 [SerializeField] private float movingSpeed = 10f; 
Похожие вопросы