Yes I am trying to write a Spaceship Flight Control ship that will use mouse and keyboard, joypad, Joystick and Joystick H.O.T.A.S controls but I have got stuck on this as I have tried to rarrange several scipts with no success and tried this Code (CSharp): using System; using UnityEngine; using System.Collections; namespace AssemblyCSharpfirstpass { public class SpaceshipFlightControls : MonoBehaviour { // Performs a mouse look. public float speed = 10.0f; public float rotationSpeed = 100.0f; float horizontalSpeed = 2.0f; float verticalSpeed = 2.0f; void Update() { // Get the mouse delta. This is not in the range -1...1 float h = horizontalSpeed * Input.GetAxis("Mouse X"); float v = verticalSpeed * Input.GetAxis("Mouse Y"); transform.Rotate(v, h, 0); } } // A very simplistic spaceplane driving on the xyz plane. void Update() { // Get the horizontal and vertical axis. // By default they are mapped to the arrow keys. // The value is in the range -1 to 1 float translation = Input.GetAxis("Vertical") * speed; float rotation = Input.GetAxis("Horizontal") * rotationSpeed; // Make it move 10 meters per second instead of 10 meters per frame... translation *= Time.deltaTime; rotation *= Time.deltaTime; // Move translation along the object's z-axis transform.Translate(0, 0, translation); // Rotate around our y-axis transform.Translate(0, translation , 0); } } } But I keep getting this and I have it 4 tines now Assets/SpaceshipFlightControls.cs(50,5): error CS0103: The name `' does not exist in the current context error how do I solve this
You have two Update() functions and too many braces, prematurely ending your class and leaving code orphaned. I'm surprised the errors aren't more specific about that though.