Hey,
You might consider using a couple of Line Traces instead of collision detection. I created a basic setup using line traces that works pretty well for me, though it is certainly not perfect and could be improved upon.
Here’s Components tab of MyCharacter BP:
Pretty standard, except I added a small Sphere component and named it CameraCollision, then attached it to Camera and moved it down a bit.
Here’s Event Graph:
First, we set a Rotation variable based on Camera Boom’s World Rotation. This gives us an angle to return to when nothing is blocking trace.
Then we perform our first trace, a Single Line Trace by Channel, with Start Location of Camera and an End Location of Mesh component. If trace hits something, we rotate Camera Boom by 1 in Pitch. It will continue doing this per Tick until nothing is blocking it. This may need some additional clamping if you have a ceiling, etc.
If first trace doesn’t hit anything, it performs a second trace between slightly lower CameraCollision component we created earlier and Mesh. This second trace is giving us a bit of a cushion before returning rotation to its initial position, so it doesn’t jitter wildly between rotating up and rotating down.
Once second trace is also returning false, we start rotating Camera Boom back down to its initial rotation.
There’s still some jitter with this set up that can probably be cleared up with some adjustments to rotation speeds and positioning of components, but you get general idea.
Hope this helps!