How to rotate x and y of third person camera follow x and y rotation of 3D object?

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

How do I…

how to rotate x and y of third person camera follow x and y rotation of 3D object?

What is the expected result

so when 3D object rotate y 90 degrees then camera will rotate y 90 degrees

i want to make game like deep 3d submarine odyssey, or like space ship driving game, where camera and object have same rotation

Related screenshots