Kill enemy by looking in its direction

Weird, the feature to look at the enemy and kill it by line trace was working perfectly last night in my other project, but doesnt seem to be working here even though its the same project just duplicated and the script is copy and pasted. can you see what ive done wrong by looking at this?