This error is caused by thisTransform or moveTouchPad not yet initialized - they “born” with null values, and if you don’t assign anything to any of them you get this error. If you can’t find the problem, post the rest of the code in your question.
Warning: If you want to reply to this answer, use the add new comment button. The Answer box is intended to be used only for answers (UA is different from forums in that sense).