Getting this going

It's buggy on the movement and I've been trying to fix if for hours. I
don't know why there is a delay in the events. but i am trying to fix
it.