Raycasting Animations

Hi. I'm trying to make a door opened with Keycode "E". My idea is when I shoot raycast to the door, the distance is calculated, and if it is at right distance and the bool is false, animation door open is played. Here is my script