How to reset camera position/rotation after trigger exit

mrstarks510
Mon, 11 Jan 2021 07:28:31 +0000
Cinematics & Media

My player character has two cameras, one for side scroller (2.D) and one for third person(TPS), each with their own spring arm. Then I have an empty actor with only a collision box. So, game starts in 2D with movement only on Y axis and no mouse control. When player enters box collision camera switches to TPS, (enabling all basic TPS mouse and player movement controls). When player exits box collision camera goes back to 2D camera. Which all of this works. What I’m struggling to solve is whatever position/rotation the TPS camera/player was in, now becomes the 2D plane of movement. Going from movement only on Y axis to only on X axis. When player exits the trigger no matter what the rotation of the player the camera rotation should revert back to Y axis.

I’ve tried set actor location and rotation. Get relative transform. Set relative location. “Find look at rotation” using the get world/ get actor location while using either the 2D/TPS cameras or spring arms or the character itself as the reference. Also view target with blend. Which did work when I had static cameras placed everywhere. That way seemed like the wrong way to do this down the line when I have 100’s of cameras to manage.

My logic as I’ve been working is: At start get the camera rotation. Store it as a variable. Then when player exits the trigger get that variable and set it as the new view target location.alt text