i'm a TOTAL beginner so this might sound like a dumb question but is there a way for the code to "forget" a line or two for a while? kinda like making it a comment but with a trigger? for example "when the player hits this collision shape, the collision shape forgets it has an animation and stops responding to the players commands"

i don't necessarily need any code to paste into my script but more-so the name of this whole idea, if it even has one?

Use a boolean flag.

var execute_this_code: bool = true

# Set the variable "execute_this_code" to false to skip this code.
if execute_this_code:
    pass # placeholder for actual code