Why play animation in set function of health variable (Godot 3D Course)

Hello everyone,

I am just wondering what the upsides of writing the code for the animation into the set function of the health variable. In the lecture this requires an if statement to check if the health decreased.
When I put the animation code inside a take_damage function I don’t need the if statement.

Both work but what would be best practice and why?
Thanks.

Different methods for different people.
I would probably be tempted to play the animation in the take_damage function as well.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms