Simple flight simulator (janmanHD2)

Add to
My games
Add to
Wishlist
Save to
Collection
No reviews
Exceptional
Meh
Skip

About

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;

        }

    }

}

Platforms
Release date
Developer
janmanHD2
Age rating
Not rated

System requirements for PC

Read more...
Simple flight simulator (janmanHD2) screenshot, image №3324424 - RAWG
Edit the game info
Last Modified: Apr 11, 2022

Where to buy

itch.io