Maybe I understand what you mean.
you can do it in two ways:
- put a condition in which when the player moves too far (i.e. XXX pixels) from an object, the camera no longer follows the player, but stops aiming at a fixed object or a certain position (x, y)
- put an invisible sprite that when it collides with the player, the camera no longer follows the player, but stops to point to a fixed object or a certain position (x, y)
Between the two options depends on how you are setting up the game.
Attention, however, if in your code the function of the camera following the player is placed in the (parent root), then it will always return to point the player: you should put the camera under the condition of a variable. If you give me the email I will send you a simple example that I have already done for another GDevelopper