Author: Eric Haines (a.k.a. Eric5h5)
More scripting suggestions
2. Acceleration (Not quite as easy)
Unless you've got the trigger for the enemy object set to a large enough radius that the enemy is always triggered off-screen, you can see that the enemy instantly goes from sitting still to full speed when the player enters the trigger (and from full speed to 0 instantly if the player dies or leaves the trigger). While you have to admire such acceleration and braking abilities, you also have to consider the whiplash the poor pilot must experience, not to mention that it doesn't look very realistic. How about fixing that so the enemy accelerates properly when the player enters the trigger, and decelerates when the player leaves?
Hint: Isn't "lerp" a silly word?
Discussion: While the first thing that comes to mind (at least for me) is making OnTriggerEnter a coroutine by using yield, and having the enemy accelerate over time using a loop, and then doing the same in reverse for OnTriggerExit, this method has a potential problem. What if the player manages to enter the trigger and then exit before the enemy has fully accelerated? You'd have the OnTriggerEnter and OnTriggerExit coroutines running simultaneously for a while, which would almost certainly result in wrong behavior. It's probably better to use Mathf.Lerp. Something like, in Update():