so i have these portals, they function their not the issue, but they can rotate the camera(their supposed to) i have a working gravity change system, so i can have these portals change gravity, now it all works, except the camera, it rotates roll/yaw/pitch but since im using default pitch/yaw controller input, when the camera gets rolled from using a portal, the pitch and yaw are relative to the world instead of the character
so rather than yaw be left-right, it becomes up-down, and pitch becomes left-right
and ive looked around and cant find anything solving this, but maybe im just blind lol
Hey @Player_toaster how are you?
I’ve been tinkering with some nodes to make this work and I found a solution for your problem!
I don’t know if this is the most elegant way to do it but It works perfectly!
Let me explain:
What I did is to multiply the X and Y values of the Input Action “Look” depending on the direction the “portal” rotates the camera.
-
To do that, I created an Enum by right clicking on my content browser:
-
And added all the posible rotations to it:
-
Then I created a variable of type “EBP_Orientation” (my enum) and added a “Switch” from that variable to my Input Action “Look”, using the “Normal” exec pin for the default values:
-
After that, I created three new functions to calculate the camera rotation based on the variable I created in the previous step:
-
Lastly, I added those functions to the corresponding exec pins on the Input Action “Look” on my Event Graph:
-
Now, you only need to set the corresponding value to the variable CameraOrientation whenever you change the characters rotation!
Hope this helps you! Let me know if this worked for you!
that would work, except for this specific case scenariao, i want to be able to have my portal at any rotation, so i can have the player end up at a 11, 32, 98, or 157 degree angle
if all else fails ill probably use this method, it looks really clean, ill just have to manualy ad 45 degree angles, and 15 degree angles
for additional information, since im realizing that theres a couple of gaps here, i can very easily access the portal source and destination, from their rotation and location, to their individual variables, so if the fix requires me to get the destination rotation its very easy
i am using the default first person bp, with some small modifications, like using the third person model
i have the destination portal stored in a variable making it easy to reference
and i would prefer the fix be modular, as in dependent on the camera roll
the way i made gravity function was taking the destinations upward vector, and then multiplying it to a negative, and setting gravity to that direction
if there is a way to make the camera inputs function relative to the camera roll im almost certain that would be the fix
unfortunately i am not great with the camera inputs