First, check whether you have ‘OK Google’ hotword detection on any screen option or not by going to Google Now Settings -> Voice -> Ok Google Detection -> “From any screen” and “From lock screen”. If the option isn’t available, just follow the simple guide given below.
- Open Google Now and search for “OK Google everywhere”
- Click any link (even if it is unnecessary for you)
- Go back to Google Now
- Go to Settings ->Voice -> and enable Audio History.
- From any screen option should now be available as settings (it may take some times to appear the option).
Keep in mind that, unlike with the Moto X any screen hotword detection, this update will not wake your phone with your voice, your screen has to be on to use your voice. Moto X has special chip to wake the phone with voice. However, Google is probably taking advantage of the existing chip in Qualcomm processors for this purpose (source)