Input.GetAxis("Horizontal") ,一直输出为 0

来源:3-6 响应用户输入-Unity3D角色控制

孙浩飞XF

2018-07-10 21:38

using System.Collections;

using System.Collections.Generic;

using UnityEngine;



public class main : MonoBehaviour {



    // Use this for initialization

    void Start () {

        Debug.Log("y  " + Input.GetAxis("Horizontal"));

//输出 y 0

    }

// Update is called once per frame

void Update () {

}

}



写回答 关注

1回答

  • 孙浩飞XF
    2018-07-10 21:39:07

    好吧,看错函数了,应该写在 update里面

Unity3D快速入门

本课程为Unity 3D入门教程,快速学会用Unity开发游戏

146124 学习 · 379 问题

查看课程

相似问题