If you're using Godot then just use the Camera2D node. Make it a child of your Player scene, flick on 'current' and you're off to the races