Hi! I’m coding a charachter following the camera. In parallell I also collect coins. If I delete the coins efter they have been clicked, the character stops following the camera (which it shouldn’t) but if I instead only change the coins opacity to 0, the code works as it should. Why? Is this a bug?
Hi Sofania,
Thank you for your question! I am not an expert coder, but I do not believe you need to include the “when” statement inside its own “forever” loop. The “when” statement already runs constantly in the background. The code shown below works as you intended.
If you wanted to code it using a “run parallel” block, you should put the “forever” loop inside the top part of the “run parallel” block, so it is only affecting the movement of the casual girl, as shown below.
I hope that helps!
Hi @Sofiania, as @BRIC has correctly explained, events only need to be declared once.
My only suggestion for improvement on BRIC’s code is to move the yellow event block to line 3, and have the forever block below it - this eliminates the need for the run parallel block.
Good luck!
Great, thanks all! I think i confused the event with an if statement