unity3d Unity错误CS0103:当前上下文中不存在名称“input”

您所在的位置:网站首页 unity错误CS0103 unity3d Unity错误CS0103:当前上下文中不存在名称“input”

unity3d Unity错误CS0103:当前上下文中不存在名称“input”

2023-04-15 02:35| 来源: 网络整理| 查看: 265

嘿,我正在学习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



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3