Hello!
I have built a simple score system that gives you a point whenever you fall off-world. I now want to increase the height of my walls by 1 meter everytime this happens. I’ve written the following script:
function Update() {
var OldScore = PointSystem.score;
if (PointSystem.score > OldScore) {
transform.Translate(0,1,0);}
}
If I put it like this, the wall doesn’t move because OldScore is always the same as PointSystem.score. However, if I put the defining of var OldScore outside function Update( ) the wall lifts off indefinitely. The solution is probably very logical, but I can’t find it.
Thank you for your help!