How to freeze camera in place

Godot Version

4.7.1

Question

Hey guys. So I’m making a space game in which the camera has to freeze if a function triggers. It goes like this:

extends Area2D


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	position.y += 100 * delta


func _on_body_entered(body: Node2D) -> void:
	if body is Player:
		#freeze camera, but i have no idea how

I just want to know how to freeze the camera in place. I tried using top level but that just set the global position back to (0, 0)

If you are using the parent-child relation ship to move the camera then you will have to use top level. You can copy it’s global position, set top_level to true, then re-assign the global position, if that helps

woah dude, that was a quick response. Thanks! I’ll try and tell you what happens.