A downloadable game for Windows

If anyone is wondering how to make it, here is the code and the plane is rigidbody based

Code:

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.UIElements;

using UnityEngine.UI;

public class FlightScript : MonoBehaviour

{

    [Header("Settings")]

    public Rigidbody rb;

    float CurrentSpeed = 35f;

    Vector3 RootSpeed;

    float zRootSpeed;

    private void FixedUpdate()

    {

        //Rotating

        RootSpeed.x = Input.GetAxis("Vertical") * 20 * Time.fixedDeltaTime;

        zRootSpeed += Input.GetAxis("Horizontal") * 20 * Time.fixedDeltaTime;

        zRootSpeed = zRootSpeed * 0.8f;

        RootSpeed.z = zRootSpeed;

        transform.Rotate(-RootSpeed);

        //Moving

        rb.velocity = transform.forward * CurrentSpeed;

        if (CurrentSpeed < 20f)

        {

            rb.useGravity = true;

        }

        else

        {

            rb.useGravity = false;

        }

    }

}


Download

Download
FlightSim.zip 21 MB

Install instructions

How to open:

-Un-zip the file                                                                                                                                                              -Open new file                                                                                                                                                              -Open FlightSim.exe

Controls: WASD

Leave a comment

Log in with itch.io to leave a comment.