I have a player with a camera that follows him across rooms until he overlaps an endcap object at the end of the room which locks the camera to not see past the wall. This works great, but the problem is the transition out of the endcap back into the normal room.
When you leave the endcap the camera needs to return to the correct position to resume following the player, which it does, but very suddenly and ugly.
The ideal solution would be some kind of condition that can detect exactly when the varible that causes the camera to lock at the endcap goes from true to false so I could smoothly transition with a lerp.
However, I don't think this exists and an else won't work because it's constant like "If your not overlapping the endcap at anytime, constantly lerp the camera breaking the scrolling" rather than what I need which is "At the moment the 'lock camera' variable becomes false, lerp the camera back in place."
If anyone has a suggestion or can help that would be lit.