Question by
SpaceEnthusiast · Jul 05, 2018 at 10:31 PM ·
simulationflightflight simlift
How do you properly simulate lift?
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
Comment
Best Answer
Answer by tormentoarmagedoom · Jul 06, 2018 at 10:23 AM
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!
Your answer
![](https://koobas.hobune.stream/wayback/20220612170125im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to add physics to flight simulator 2 Answers
Key press simulation on android, 1 Answer
Can android device interact with the pc unity game? 2 Answers
How to simulate adhesion of water? 0 Answers
Xcode7.3 iPad Simulator Failure 0 Answers