How to implement target lock feature like in Dark Souls?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By cjay90

I am working on a isometric/3rd person (graphical style is kinda like Octopath traveler) ARPG game heavily inspired by Dark Souls. But during development I ran into a problem:

Let’s say I have the player and a practice dummy. Without a target locked on, hitting the left/right buttons would cause the character strafe left/right normally. But if I press the target lock button and then move left/right, the character circles around the target instead.

Not only that, the camera would also snap to the target (or to a point between those two?), so that the target is in focus but both of them are still visible on the screen.

I tried to figure it out by using Raycasts but I have to understand how they work first. So, no solution, yet.

Can you guys help me out?

Edit: I forgot to mention that this game is in 3D space using 2D billboard sprites as characters, if that matters.

:bust_in_silhouette: Reply From: alvarocafe

I’m working on something like this, if I succeed, I’ll post here.