In this project I have a character and a camera that follows it.
The camera has a position relative to the character that was defined as (x = 0, y = 0, z = 0) and also its rotation:
I found a value close to its position and opposite angulation, but not really the correct value:
By pressing the Q key, the camera shifts to the position and angulation that I have discovered. Releasing the Q key, the camera returns to its initial position:
IN GAME:
As you can see, the inversion is not 100% correct.
One of the ways I thought, is a way where I take this relative value from the camera (x = 0, y = 0, z = 0) and with that:
I put the character's mesh at the location (x = 0, y = 0, z = 0) at the level and so, as the camera will be (for example) x = -250, y = 0, z = 300, it's just I invert the value of x. The angulation is simpler to deduce, but it would be interesting for me to also derive its relative value (0, 0, 0).
EDIT 1 (Attempt that I did and that almost worked out)
By clicking the down arrow to the left of the values, you can select whether you want the variable to be Relative or World (I did not know that):
Before it was all 0, it now has a value:
Taking the minus sign, I was able to figure out the opposite position:
New position:
It happens that at the time of changing the angulation from relative to absolute, a conversion is not made:
I can not get absolute value equivalent to relative. What happens is that the value 0, 0, 0 is also defined for the absolute rotation. In the image below the camera was exactly in the same position as the VR camera:
I discovered by trial and error the equivalent angulation between relative and absolute:
BLUEPRINT:
The code works correctly, but I feel that again I did not get exactly the position and opposite angles.
Here are some screenshots of the game:
Local X with NORMAL CAMERA:
Local X with OPPOSITE CAMERA:
Local Y with NORMAL CAMERA:
Local Y with OPPOSITE CAMERA:
Note that in the opposite camera you can see the end of the world (sky) from wherever you are, which is not the case with the normal camera. I noticed this, and so, I think once again I did something wrong.