Let me see if I have got it right: you are using my demo (terrain + code) and it works fine, but then you do something and the code doesn't run properly anymore. What exactly do you do? Please give me as many details as possible.