As the name suggests, a Homing Projectile seeks its target even if the weapon firing the projectile is not pointed directly at the intended target.
Setup is trivial. Simply attach the Combat module’s Homing Projectile component to any projectile. The component’s Ammo Rigidbody property will be automatically set if the game object contains a Rigidbody component.
The Propulsion settings control the movement behavior of the projectile:
- Seconds To Wait Before Propelling: Delays the propulsion of the projectile by a number of seconds. A value of 0 (or less) results in no delay.
- Maximum Turn Angle: The maximum angle, in degrees, that the projectile will turn while homing in on its target.
- Velocity: How fast the projectile moves toward its target - this should likely match or exceed the max velocity of the projectile ammo if propulsion is delayed. If there is no delay, this setting will effectively override the projectile ammo’s min/max velocity.
Turning off gravity on the Rigidbody is optional, but might be desired depending on the specific projectile.