C/C++

Помогитееее в UNITY 3D я только начел

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

public class camera : MonoBehaviour
{
private float x;
private float y;
public float sensitivity = -1f;
private Vector3 rotate;

// Start is called before the first frame update
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}

// Update is called once per frame
void Update()
{
y = input.GetAxis("Mouse X");
x = input.GetAxis("Mouse Y");
rotate = new Vector3(x, y * sensitivity, 0);
transform.eulerAngles = transform.eulerAngles - rotate;
}
}

вот весь код он не хочет работать

Assets\camera.cs(21,13): error CS0103: The name 'input' does not exist in the current context

вот ошибка

Assets\camera.cs(22,13): error CS0103: The name 'input' does not exist in the current context
помогите пажауйста !!!!!Я НАВИЧОККККККККККК!!!!!!!!!!!!
Саша Мишин
Саша Мишин
116
 using System.Collections; 
using System.Collections.Generic;
using UnityEngine;

public class camera : MonoBehaviour
{
private float x;
private float y;
public float sensitivity = -1f;
private Vector3 rotate;

void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}

void Update()
{
y = Input.GetAxis("Mouse X");
x = Input.GetAxis("Mouse Y");
rotate = new Vector3(x, y * sensitivity, 0);
transform.eulerAngles = transform.eulerAngles - rotate;
}
}
Гений ты хотя бы без ошибок пиши
Юрий Бузовский
Юрий Бузовский
356
Лучший ответ
Саша Мишин ныныныныны у меня по русскому онли 2 3
Я НАВВОИЧОКО Я ВЫАЫВА ЫВА ПУК. ПУК. ПУК. .ПУК.

бегом книги читать, бестолочь
Эти ошибки происходят из-за того, что `input` должно быть с большой буквы - `Input`. Unity требует, чтобы все встроенные классы и их методы были написаны с верхним регистром.

Ваш отрефакторенный код будет выглядеть так:

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class camera : MonoBehaviour
{
private float x;
private float y;
public float sensitivity = -1f;
private Vector3 rotate;

// Start is called before the first frame update
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}

// Update is called once per frame
void Update()
{
y = Input.GetAxis("Mouse X"); // Здесь было изменено с 'input' на 'Input'
x = Input.GetAxis("Mouse Y"); // Здесь было изменено с 'input' на 'Input'
rotate = new Vector3(x, y * sensitivity, 0);
transform.eulerAngles = transform.eulerAngles - rotate;
}
}
```
Теперь ваш код должен работать без ошибок. Здесь мы используем `Input.GetAxis`, чтобы получить данные от мыши, и затем применяем их для вращения камеры. Важно отметить, что значения `Mouse X` и `Mouse Y` должны быть настроены в вашем Input Manager (Менеджер ввода) в настройках проекта Unity.
хз не играл