Top.Mail.Ru
Ответы

Помогите решить проблему error CS1519: Invalid token '=' in class, record, struct, or interface member declaration

12345678910111213141516171819202122232425
 using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour
{
    
     public float_rotateSpeed = 10.0f;

     private void Update()
     {

        float rotate = 0f;
        if(Input.GetKey(KeyCode.Q))
           rotate = -1f;
        else if(Input.GetKey(KeyCode.E))
           rotate = 1f;

        transform.Rotate(Vector3.up * rotateSpeed * Time.deltaTime * rotate);
     }

}

Скрипты верны, прокрутил, но теперь ошибку при запуске игры в Unity( нажатии на play(треугольник)) выдует ошибку (All compiler errors have to be fixed before you can enter playmode!) не в console в полупрозрачном окошечке. 
 
По дате
По Рейтингу
Аватар пользователя
Мыслитель
10мес
12345678910111213141516171819202122
 using System.Collections; 
using System.Collections.Generic; 
using UnityEngine; 
 
public class CameraController : MonoBehaviour 
{ 
     
    public float rotateSpeed = 10.0f; // Изменено имя переменной 
 
    private void Update() 
    { 
 
        float rotate = 0f; 
        if(Input.GetKey(KeyCode.Q)) 
           rotate = -1f; 
        else if(Input.GetKey(KeyCode.E)) 
           rotate = 1f; 
 
        transform.Rotate(Vector3.up * rotateSpeed * Time.deltaTime * rotate); 
    } 
 
}