Hold on a minute, my wife was having the same problem with her Moto G also whilst charging.
After looking around the net the one thing that truly helped (and this has happened a couple of times now), was to boot the phone into recovery (press and hold Power Button + Volume Up for about 10 to 20 seconds)and choose the restart option.
Reboot might take a minute or two before anything happens but this should work. Incidentally the first time this occurred on the wife's phone was directly after a system update.