你编辑器里没有配置对应的输入轴 菜单Edit->ProjectSettings->Input->在属性面板Axes里配置对应的输入轴 你的Horizontal是不是拼错了
用c#写的脚本,输入..我是网上找的脚本~对编程0基础ArgumentException: Input Axis Horizontal is not setup. To change the input settings use: Edit -> Project Settings -> InputPlayerControl.Start () (at Assets/Script/PlayerControl.cs:11)
在没按任何按键的情况..为什么在没按任何按键的情况下xInput = Input.GetAxisRaw("Horizontal");会一直输出-1按键应该没问题,把默认的键位改了之后也还是-1,最后直接改了变量名就好了,不知道是什么原因
;Rigidbody>(); } // Update is called once per frame void Update () { float h = Input.GetAxis("Horizontal"); float v = Input.GetAxis("Vertical"); rd.AddForce(new Vector3(h, 0, v智能推荐在Unity3D中开发的Outline Shader Swordmaster Outline Shaders 特点 本资源包共包含三种Outline...
5 “MoveRotateTest”脚本具体内容如下usingUnityEngine;publicclassMoveRotateTest:MonoBehaviour{publicfloatmoveSpeed=5f; publicfloatrotateSpeed=30f; //Updateiscalledonceperframe voidUpdate(){floath=Input.GetAxis("Horizontal"); floatv=Input.GetAxis("Vertical");transform.Translate(newVector3(v*Time....
// keep track of whether or not the character is walking or running m_IsWalking = !Input.GetKey(KeyCode.LeftShift); #endif // set the desired speed to be walking or running speed = m_IsWalking ? m_WalkSpeed : m_RunSpeed; m_Input = new Vector2(horizontal, vertical); ...
【问题】Input...打算用这个来进行位移float deltaX = Input.GetAxisRaw("Horizontal") * speed; float deltaZ = Inp
大佬门求教下关于In..大佬们,我刚接触Unity不久,请教下这个问题的解决方法用Input.GetAxis("Horizontal")如果先按下A键,不放后按下D键,会固定为按下D键那一帧时A键的值。只
axesToUse = AxisOption.Both; // The options for the axes that the still will use public ControlStyle controlStyle = ControlStyle.Absolute; // control style to use public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input public ...
(); } m_Camera.transform.localPosition = newCameraPosition; } //获得键盘输入 private void GetInput(out float speed) { // Read input float horizontal = CrossPlatformInputManager.GetAxis("Horizontal"); float vertical = CrossPlatformInputManager.GetAxis("Vertical"); bool waswalking = m_Is...