how to change the offset of a camera2D while the program is running?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By corndrology

I have a Camera2D node connected to the player. however I would like the camera to go down relative to the player while down is being held. I believe to do this I need to change the offset. How do I change the offset?

:bust_in_silhouette: Reply From: SnapCracklins

Actually, if you just click the “Current” box in the Inspector on the camera, that should do it, i believe, if you’re trying to get it to move WITH your player object. If you’re trying to move it relative to the player (independent camera movement detached from player movement) then it’s just a matter of changing its position along with the code. Something like:

Func _input(event):
### your action code here
     #Camera2D.position.x +1