Here the case use puzzle game template, in which contains 1st person view facing towards the ground:
Open the puzzle Character BP
Add 2 cameras in the component, not parent under anythig, name as FP_camera, and VR_camera
Add vairables as IsPanning, InitalX, IntialY, Camlock, Speed
image.png
Create a event graph as follow:
image.png
Remark:
for - node (connect to Get mouse Position node) , type subtract:
image.png
2. ForActorWorldOffset node, R click on Delatlocation and split struct pin
image.png

Delete the top view camera (if any) in scene, replace with Player Start

To add boundary in the scene, so it won’t move away to no where:
Add mesh walls (2 walls or 4 walls within the area where want to lock):
Go back to Event graph, tick Sweep in AddActorWroldOffset node (the one at the end)
image.png

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.