I'm making a top-down 2D game. I want the camera to follow the player, but I also want it to move slightly in the direction of the cursor, just the same as in Enter the Gungeon.
At first it seemed easy, just take the vector from the player to the cursor, multiply it by something like 0.2 and place the camera in there. But after testing, it looked really weird. Trying to make it better I multiplyed the the vector by it's own magnitude to make it smooth it when the mouse is close to the character. I was better but still weird when the cursor if far from the player.
Right now I really don't know how to make it feel better, I actually opened enter the gungeon and made a couple of measurement with a ruler over the screen.
distance from center of the screen to cursor — distance from center of the screen to character — percentage along the vector. (not very accurate)
4cm — 0cm — 0%
5cm — 0.2cm — 4%
10cm — 1cm — 10%
18cm — 3.5cm — 19%
26cm — 5.3cm — 20%
I would be great if someone could give me some ideas on how to get closer to this results