I have been trying to look into this a bit, I think I came down to the conclusion that it’s not possible to ensure that the exact same location will be the center, especially when you target things that are close to the camera. The trace in combination with the collision of the objects will not be able to return the exact same point. And I think it really depends on the curvature of the collision at your target.
Even in the video reference that you posted it is not the same point after switching.
I did make some improvements, and also made it possible to move the camera while switching
I think the way it’s done in the video reference is with the use of an object relative to the player position and rotation; when switching shoulder, the focus point (where the camera is looking) stays at the same distance, regardless of turning the camera (& player).
I’ve did some test using something similar, where upon pressing the switch button, a Target Object (Arrow component) is moved to the hit location of the trace, which the camera looks at; it worked very well, with a couple of issues:
there was a weird lag; the camera was looking ahead of the focus point during the switch until completion where it nests where it’s supposed to look at.
it screwed with the Camera & Spring Arm; I don’t know enough about these to know exactly what was not being set properly, but here’s a video of the same bug; notice how after switching, the camera starts having some roll when pitching up or down?
While the offset was correct, the player character was clearly not at the right distance from the center of the screen.
[Older Video]
I’ll look into your new version, thank you for your time ^^
@J-07211@zeaf Zeaf’s (updated) solution is almost working perfectly, but when the camera is up close (floor, wall, etc) the aim location is not the same for both camera positions.