- Home /
Realistic 2D flight physics?
Hi. I'm trying to make a realistic 2D flight game.
This is my current code:
if(Input.GetKey(KeyCode.UpArrow)) {
rigidbody2D.AddForce(transform.right * 500 * Time.deltaTime);
}
if(Input.GetKey(KeyCode.RightArrow)) {
rigidbody2D.AddTorque(-10 * Time.deltaTime);
}
if(Input.GetKey(KeyCode.LeftArrow)) {
rigidbody2D.AddTorque(10 * Time.deltaTime);
rigidbody2D.AddForce(transform.up * 100 * Time.deltaTime);
}
This is of course not very advanced.
I was wondering if you could add some improvements to my script, or do you know about another 2D flight physics script?
Thanks in advance.
Andreas.
Comment
Just a note, "realistic" and "2d" are sort of contradictory
Your answer
Follow this Question
Related Questions
Creating my own flight physics? 2 Answers
Dynamic flight physics help. 0 Answers
2D plane physics, add torque based on direction 1 Answer