Move position according to real-time data position

Hi! As you probably have guessed from where this question is placed I am new to unreal. The project I am currently trying to do is the following:

I am using a camera to track the nose position of a person. The coordinates of this position (now only x and y, but later I will add z) are being sent to unreal using mqtt. This part is all working and done but now I am stuck on the unreal part.

I want the positions being inputted in unreal to influence the position of the player. So I already have an existing unreal rendering but now if the “real” person stands in front of it and moves to the left I want that the view in the game also to move to the left… (to create a kind of parallax effect).

But I have no idea how to do this… anyone got any tips were to start? Any help is appreciated.

Here’s my stab at it. I’m using the mouse cursor as a placeholder for your nose position. I compare it to the viewport size to get a 0-1 normalized input so that 0 represents fully up and to the left, and 1 represents fully down and to the right. I had to divide that by an additional 1.5 due to viewport scaling, and the math only works in another PIE window, not the main editor.

And then I use those inputs to set a relative location for the character. I multiple the 0-1 range by my desired distance that the player should move. For the parallax effect I inverted the up and down movement. To take this further you’d probably also incorporate some sort of pawn rotation.

I run both those events on tick like this.

I didn’t put the logic inside the Pawn, so I needed a reference to the pawn when the game starts.
BeginPlay