Trying to make the Viewport frame angle sync with the player's camera

What I’m trying to achieve is to make the viewport frame’s camera line up so the object within the frame aligns up with the world XYZ. The problem is here:

In-studio, it automatically aligns itself without any problem: https://gyazo.com/688a8b9114b229f25085d2ca9a7492be

But when I go to play, it does not align anymore: https://gyazo.com/66e8a6a72a4052af5ae9b82ebec30b1f

How would I fix this?

You can get the players camera rotational values, sync and adjust it with the rotation of the object in the viewport, though there is quite a bit of math involved.

You can try adjusting some code from a compass to work with your needs