For use that just add a camera2d to your player and make it current. Change the path of your camera in line 11.
I mean, i use this for now, because im trying to avoid as many process as possible. Then let the process for the IA enemies. I think is a good practice. But i am in other war right now.
Anyway, if you want move the player 'position' for simulate shaking you could use this
# player script
var can_shake = false
var time = 0
var counter= 2 # set time
func _process(delta):
if can_shake:
if time < counter:
time += delta
global_position.x += lerp(rand_range(-5, 5), rand_range(-5, 5), time / counter)
global_position.y += lerp(rand_range(-5, 5), rand_range(-5, 5), time / counter)
#to activate:
your func():
time = 0 # reset
counter= 3 # set time
can_shake = true
#change the rand range (-5, 5) to set the 'shake' amount (position)