嘿,我正在学习Unity开发引擎,但是当我尝试将我的脚本关联到我的精灵时,我得到了这个错误:Unity错误CS 0103:当前上下文中不存在名称“input”,我的代码非常简单, using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Playermovement : MonoBehaviour {
public float speed;
private Rigidbody2D myRigidbody;
private Vector2 change;
void Start() {
myRigidbody = GetComponent();
}
void Update() {
change = Vector2.zero;
change.x = Input.GetAxis("Horizontal");
change.y = input.GetAxis("Vertical");
Debug.Log(change);
}
}那么有没有人有我问题的答案?我会接受任何帮助,谢谢! 我正在使用ItelliJ IDEA编辑我的C#脚本和Unity 2019.3.8f1 personnal
|