Problem in Update Function

Please use code-tags when posting code. Also note that this is in the 2D features forum, you should post scripting questions here.