Controlled Flight is an asset to be used in Unity. It provides functionality for controlling the movement of objects in realistic trajectories. The focus is on ease of use, robustness as well as realism.
You can find it in the Unity Asset Store.
The algorithms are based on well known, and universally used, methods used in aerospace engineering.
The asset includes:
- Missile guidance algorithms. Proportional Navigation, Augmented PN, Line-of-Sight guidance, etc…
- Path following and Waypoint Autopilot.
- Thrust and speed control. Simple automatic speed control to complex multistage rockets.
- Fully documented and flexible settings in Unity Inspector.
- Advanced features:
- Flexible launch directions. Towards target, Vertical launch, Custom Direction, etc…
- Aerodynamic drag.
- Flexible Target intercept settings.
- Terrain Following (experimental)
- Missile performance limitations. Limit maneuver and flight time, missile dynamics, etc…
- Lofted/elevated trajectories.
- Flexible Waypoint guidance settings.
- Events. Easy to use for triggering functionality, such as graphical effects (particles systems).
Typical use is missile guidance and aircraft autopilots. But the algorithms are very flexible and are applicable for many use cases. It will work for controlling boats as well as submarines. The control of animal movement is also a possibility, for example birds and bats.
Start by reading the introduction. Detailed information can be found in the other pages.
The asset includes source code. A short reference of the code can be found here.
More videos on YouTube.
Controlled Flight Usage
Basic setup for target guidance:
- Create Game Object at relevant position
- Add Component MissileSupervisor
- Select Target by dragging it to the “Target” filed in the MissileSupervisor.
Additional settings often need to be done. For example, speed may need additional control.
For path following the same procedure is valid, just input waypoint coordinates or select waypoint objects instead of selecting target.
The main settings is the major choices. These are which type of trajectory is used, following a path or intercepting a target. Then the settings are done to either describe the path or assigning the target.
The guidance properties are settings for the path following or target intercept algorithms.
Settings for the limitations and similar properties of the movement of the object. Details can be found here.
Settings for behavior of the object when intercepting the target. The target can be the last waypoint in a path with the correct settings. Details can be found here.
Launch and Speed control
The behavior of the object before launch can be adjusted here.
The speed of the object can be controlled in detail, using different methods. This is a major feature for the behavior of the object.
Detailed descriptions can be found here.
The MissileSupervisor component invokes relevant events. These events can be used to trigger functionality in other object or components. Events are described here.
The main functionality is in the MissileSupervisor component. It is in many cases easy to add functionality. The new functionality can be small changes or new advanced features.
Typically the new functionality is added with components. These execute in parallel with the MissileSupervisor.
Included in Controlled Flight are a few extra component, Each seamlessly plugs in with MissileSupervisor.
Some advanced features included:
- Advanced drag.
- Advanced maneuver limitations.
- Change in speed at waypoints.
Each of these are done in very few lines of code.
The advanced plug ins can be found here.