Flight Physics 1.0.0
This is a collection of force and calculation scripts used to produce realistic-looking flight physics.
Asset store: Combat Flight Framework | Physics | Unity Asset Store
Physics
This is designed so that you place particular types of directional force components at points around your object. As they generate force, there are calculations to turn the force into force and torque on the rigidbody. This is intended to be flexible and not just specific to flight physics.
Flight
Then there are components to decide the specific flight forces; plane aerodynamics (fuselage, wing, elevator) and aileron aerodynamics (also for rudder).
Hinges
There’s a multi-purpose script for transitioning between two values, over time, with a set acceleration and/or max speed. It’s used for the smooth movement of the control-surfaces and almost everything else; smooth throttle control, opening of undercarriage etc.
Rotation control
So you could then hook up the forces to input, and you might have a WW2 plane that’s realistically hard to control. Modern planes are more stable than that and make micro-adjustments to keep that plane flying straight. There is a script provided that automatically does this, for each axis of control, for whatever forces you apply to your rigidbody (or aircraft). In the demo there are 6 of these scripts on the aicraft controlling; ailerons, elevators, rudder, and 3 axes of vertical thruster balance.
Detection
Uses a set of scripts that emit, reflect and detect a vector of emission types: radar, infra-red and optical. The detections are done by terrain line-of-sight.
Weapons
There are small modular scripts for building up weapon points, reloading, aiming, turning turrets, and projectile behaviour.
Spawn
There are small scripts used for placing items in the world and on aircraft at runtime. Weapons rely on these to spawn projectiles.
Timing
The flight scripts run to an independent timing component that stays very closely synchronised with Unity time. However it overrides Time.timeScale to keep Unity time running at real-time. Use the newly provided TimeScale to control the rate of time.
Some notes
- It’s the first release, so documentation is brief at 14 pages. The important scripts have detailed tool-tips.
- The demo scene is designed for the ‘linear’ lighting setting.
WebGL demo
The playable WebGL demo is available here: https://www.ucassets.com/
See the bottom of the main page for the link and controls PDF.