the problem is that when I build the environment - the camera moves through it, that is, through mountains, houses, trees, and I need the camera not to come into contact with these objects

Hello
The following problem arose - I have a c++ code that is responsible for moving the camera around the field in a random order and which is focused on the object we selected, the problem is that when I build the environment - the camera moves through it, that is, through mountains, houses, trees, and I need the camera not to come into contact with these objects
maybe someone can help me figure out what to do with it? thanks for the answer

Hi, Artem!

Do you mean the camera goes THROUGH the mesh (it CLIPS it) or you simply do not want the camera to go NEAR those meshes at all?

I don’t use C++ in Unreal, so I can’t help you with code, but, typically you can TAG those objects or create custom CHANNELS that tell the camera “stay away from me”.

You can create a “maximum proximity case”, where your camera is allowed to only get to “x” units in proximity/closeness to the TAGGED/CUSTOM CHANNELED objects.

Then you would use an tick function to evaluate the conditions in real-time.

1 Like

Yea, i mean that the camera goes through the mesh, and I don’t need her to do it, and this object - landscape :slight_smile: this is a specific task, I will try your ideas tomorrow, I will let know about the result, thanks a lot!

1 Like

So, custom channels help a bit, but the problem has not completely disappeared, there are still misunderstandings in collisions(

1 Like

Can you post a video please?


thanks for your help) the camera should follow the object we specified, it does, but sometimes it passes by mountains or other objects. the test environment did

1 Like

Ahhh, I see!

Okay, you can create a LINE_TRACE going up, and if it COLLIDES with the landscape, then the location is INVALID.

So, anytime the camera is BELOW the landscape, the game will skip to the next location OR you can TRANSLATE/MOVE the camera up by “x” centimeters.

1 Like

Complete! thanks a lot sir!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.