Restrain player camera to a mesh

the following problem:

i want to restrain the player camera onto a certain mesh when a(left) mousebutton is pressen.

so far i worked my way around it like this:

i make a linetrace and ignore all other actors except the mesh i want to restrain it to. The location of the linetrace is used to update the location of another blueprint, a target.
everytime the linetrace is not hitting and the mousebutton is pressed i get the player actor location and the target actor location and set a “find look at rotation” node to set the controlrotation of the camera.

it works but its a bummer, it shakes, is not really stable and in vr mode instead of restraining it restrains the mesh to the view of the headset.

any idea what im doing wrong?

In VR you should not move camera by yourself, not unless your game is just silly joke to make people puke on carpet. Really do not touch camera in VR. You have all those problems bacause of concurrent camera location updates, your code is fighting native code for VR camera.

If you want to add some accent on items in VR search for outline postprocess material for unreal. There is some free and great example somewhere on intertubes.

thx for the help, that did the trick basically, i just restrained the controllers