Camera3d transform not transforming

Godot Version

Godot 4.0


the following code:

func _physics_process(delta):
	if Input.is_key_pressed(KEY_MINUS):
		$Camera3D.transform.origin.z = 10

is simply not transforming the camera and i am not entirely sure why, but there was a single instance it transformed for a split second and went right back to where it was

this is the full code:

extends CharacterBody3D
var SPEED = 7.5
var playercamera
var playermesh
var look_dir: Vector2
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
var camera_sens: float = 1

func _ready():
	playercamera = get_node("Camera3D")

func _unhandled_input(event: InputEvent) -> void:
	if event is InputEventMouseMotion:
		look_dir = event.relative * 0.001
func _rotate_camera(sens_mod: float = 1.0) -> void:
	#playercamera.rotation.y -= look_dir.x * camera_sens * sens_mod
	self.rotate_y((look_dir.x * camera_sens * sens_mod)*-1)
	playercamera.rotation.x = clamp(playercamera.rotation.x - look_dir.y * camera_sens * sens_mod, -1.5, 1.5)

func _physics_process(delta):
	if Input.is_key_pressed(KEY_MINUS):
		$Camera3D.transform.origin.z = 10
	# Add the gravity.
	if not is_on_floor():
		velocity.y -= gravity * delta

	if is_on_floor() and self.velocity == Vector3.ZERO:

	# jumping
	if Input.is_action_pressed("ui_accept") and is_on_floor():
        if Input.is_action_just_pressed("ui_text_scroll_up"):
			velocity.y = JUMP_VELOCITY
	    if Input.is_action_just_pressed("ui_text_scroll_down"):
	# Get the input direction and handle the movement/deceleration.
	var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
	var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
	if direction:
		if is_on_floor() and not Input.is_action_just_released("ui_accept"):
		velocity.x = direction.x * SPEED
		velocity.z = direction.z * SPEED
		velocity.x = move_toward(velocity.x, 0, SPEED)
		velocity.z = move_toward(velocity.z, 0, SPEED)


i am new to godot (therefore, gdscript) and frankly programming in general so i am well aware this might be very poor code

i thank anyone who dares help vehemently

Try to do like this

if Input.is_action_pressed("minus"):
     $Camera3D.transform.origin.z = 10
     #If not works, do this
     #$Camera3D.position.z = 10
     #If still not working, tell me any error showing in the output?