How do I use "Set View Target with Blend" and avoid moving through other meshes?

I use Set View Target with Blend in my project to make a bit of a cinematic effect. So I have one cinematic camera actor in the world that I, at random times, move to a specific location and then blend to it from the player camera.

For example: the very first sunrise in the game prompts such a blend from wherever the player is on the landscape to the cinematic camera located on a hill where it has line of sight to the sun.

My issue is that the blend will potentially move through the terrain or other meshes on the map while traveling to the target cinematic camera. How can I get around this? There is no sweep function for this… a spring arm would not work since non of the two cameras are actually active during the transition (I assume). Any advice?

Thanks in advance!

Thank you for the response, I’ll read into that and see if I can figure it out.

I don’t think this is possible with Set View Target with Blend as (I’m also assuming) that neither camera is active during the blend/transition, so adding a collision box or spring arm to the camera’s actor is no use. If the path between the two cameras is known and fixed, then the simplest solution would be using a spline to map out the camera path by hand, but that wouldn’t work for something dynamic like blending from wherever the player is to another location. For this it might be possible to use the AI navigation system to dynamically find an obstruction-free path from point A to B, and then drive the camera using a timeline over that path with some added elevation and smoothing. I haven’t tried it but I think you can use Find Path to Location Synchronously to query for the path.

I have decided to try another method of doing this that should work for my project.

I will create a second cinematic camera right above the player character. Then make a line trace to where the camera needs to go to and test for any hit. If there is a hit I’ll move the camera slightly higher and test again and repeat this until the hit result is false. As soon as it is false I’ll start the process, blend from player camera to first cinematic camera that is at the required height to avoid all obstacles and then blend from there to the final cinematic camera.

Not sure if this will still look good, but It’s worth a try.

1 Like

Sounds like a good solution. Let us know if that works out. Good luck!