How does one move camera above the actor/mesh it is overlapping on?
Currently I have setup that whenever the character capsule overlaps another mesh, it gets the bounding box of the actor/mesh and adds the Z value to the camera position and once the overlap ends, get that actor’s bounding box once again and subtract the z value from the camera position.
However, I am not sure if this works as I can notice that sometimes the camera zooms in/out a bit extra.
I have tried looking for a way in the the character movement component to see if i can walk the character over any mesh so it automatically moves the camera up.
Is overlapping efficient way of doing this, or is there a better way of doing this?
and if overlapping is the efficient way, how does one make sure no extra zoom in/out is added?
Current Design:
(green text is when it is overlapped, and red text is when overlap ends and the Z value goes back - which as you can see is increasing and decreasing alot)
I think the issue with my current design maybe that if the character overlaps one actor/mesh and without ending that overlap, starts another overlap of same height in same place, that zoom is added again.