Hello,
I am trying to make a flight simulator in unity, but I can’t figure out how to simulate the lift correctly. I would have followed a tutorial, but none of the tutorials I can find are realistic. Here is my code so far:
using UnityEngine;
public class Lift : MonoBehaviour {
//References
public Rigidbody rb;
//Variables
public Vector3 vel;
public Vector3 liftOffset;
public float liftoffset = 200f;
public float speed;
void Start () {
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update () {
vel = rb.velocity;
speed = vel.magnitude;
rb.AddRelativeForce(transform.up * liftoffset * speed * Time.deltaTime);
}
}
Thanks in advance
Good day.
Ithink you need to do it with an “acceleration” to liftoffset. Dont make it a co stant value, make it commemce at some value amd i creare it during time, to make it more realistic.
Bye!