Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SuperCrusher22 · Sep 25, 2021 at 02:22 AM · inputaxisinput.getaxissetup

Input Axis is Not Setup

Hello. I am working on a flight simulator. I watched a tutorial on making air flight and downloaded an asset used in the video given by the creator. In one of the scripts, it is looking for an axis called, "Yaw." But when trying to run the game I get an error saying Input Axis "Yaw" is not set up. This is thescript, is something wrong? using System.Collections; using System.Collections.Generic; using UnityEditorInternal; using UnityEngine; using UnityEngine.SceneManagement;

 public class AirplaneController : MonoBehaviour
 {
     [SerializeField]
     float rollControlSensitivity = 0.2f;
     [SerializeField]
     float pitchControlSensitivity = 0.2f;
     [SerializeField]
     float yawControlSensitivity = 0.2f;
     [SerializeField]
     float thrustControlSensitivity = 0.01f;
     [SerializeField]
     float flapControlSensitivity = 0.15f;
 
 
     float pitch;
     float yaw;
     float roll;
     float flap;
 
     float thrustPercent;
     bool brake = false;
 
     AircraftPhysics aircraftPhysics;
     Rotator propeller;
 
     private void Start()
     {
         aircraftPhysics = GetComponent<AircraftPhysics>();
         propeller = FindObjectOfType<Rotator>();
         SetThrust(0);
     }
 
     private void Update()
     {
         if (Input.GetKeyDown(KeyCode.R))
         {
             SceneManager.LoadScene(0);
         }
 
         if (Input.GetKey(KeyCode.Space))
         {
             SetThrust(thrustPercent + thrustControlSensitivity);
         }
         propeller.speed = thrustPercent * 1500f;
 
         if (Input.GetKeyDown(KeyCode.LeftShift))
         {
             thrustControlSensitivity *= -1;
             flapControlSensitivity *= -1;
         }
 
         if (Input.GetKeyDown(KeyCode.B))
         {
             brake = !brake;
         }
 
         if (Input.GetKeyDown(KeyCode.LeftControl))
         {
             flap += flapControlSensitivity;
             //clamp
             flap = Mathf.Clamp(flap, 0f, Mathf.Deg2Rad * 40);
         }
 
         pitch = pitchControlSensitivity * Input.GetAxis("Vertical");
         roll = rollControlSensitivity * Input.GetAxis("Horizontal");
         yaw = yawControlSensitivity * Input.GetAxis("Yaw");
     }
 
     private void SetThrust(float percent)
     {
         thrustPercent = Mathf.Clamp01(percent);
     }
 
     private void FixedUpdate()
     {
         aircraftPhysics.SetControlSurfecesAngles(pitch, roll, yaw, flap);
         aircraftPhysics.SetThrustPercent(thrustPercent);
         aircraftPhysics.Brake(brake);
     }
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by FlaSh-G · Sep 25, 2021 at 10:15 PM

"Yaw" is not one of Unity's default input axes, you need to set it up.

https://docs.unity3d.com/Manual/class-InputManager.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

161 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

change character movement axis in respect to camera orientation? 1 Answer

How Do I Snap Input Between 1, 0, and -1 0 Answers

Force input on Button? 1 Answer

how to use the axises on the xbox one controller? 0 Answers

Input returns 0 until released and pressed again if held down before start of scene 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges