All Questions



Feedback / Bug

Hi, you asked for feedback on the assignment :-) 

It was a lot of fun and the right amount of difficulty. Although I didn't understand what was meant with the padding_zero bit in the assignment text until I saw the solution video (so my own assignment included a coin counter without 0 padding). Perhaps the text can be clarified a bit in the assignment?

Also a small bug I experience with coins is that if I jump into coins and then fall back into them again, they get counted 2 times for the score counter. Seems the body_entered gets called twice (entering from below, and then again from above). 

PS. fantastic course, helped me refine a lot of mistakes I was making in designing my first games. One small tip I'd give is to include more assignments in the course, they are fun and activate you a bit more :-) 

  • Nathan Lovato replied

    Thanks for the feedback, I'm taking note to review the assignment.

    Regarding the bug, it sounds like a missing call to queue_free() on the Coin node. In your Coin.tscn scene, the picked animation should have a call to queue_free(), like this:

    This is what causes the coin to be destroyed, preventing you from picking it again.

  • D
    JoepXIV replied

    Cheers Nathan, thank you.

    The queue_free() is there in the same spot as the screenshot. The coin does successfully delete, so that seems to work fine. Maybe the issue is if you enter the coin again before the animation finishes (so within 0.4 seconds), that it didn't have time to destroy itself yet?

    Note this is a minor bug and only possible if you put coins above you that you can jump into and are low enough so that you fall back into them again if I understand it correctly.

  • Nathan Lovato replied

    Ah I see, yes then indeed. You'd need to add a call to set_deferred("monitoring", false) at the start of the animation (or to disable the collision shape node) to instantly disable it.

    I see now in the screenshot above we're toggling monitorable, but as the coins are the ones monitoring, we should target the monitoring property instead.

    Why call set_deferred? When the collision happen and we start the animation, Godot will be in the middle of a physics update. You can't directly change physics properties at that time. The set_deferred function waits for the update to finish before changing the value.