Issue with Camera Blocking Volumes

I have run into an issue with camera blocking volumes and I’m hoping someone knows the interaction I’m having. I’m setting up the camera to work in two fundamental ways:

  1. Bound to the player character, with some zoom in and out controls adjusted via spring arm length and pitch changes.
  2. Freestyle camera, similar to the one used in the editor where you use WASD to move and the mouse to change direction.

I have not set all the functions of the cameras up fully, but have some basic movement working and wanted to stop the camera from clipping through the ground and walls. I tried to use the camera blocking volume to prohibit it from moving through the terrain. The blocking volume worked great for the first camera mode when it was bound to the player character. It doesn’t allow the spring arm length changes to move the camera past the wall but it does let the camera move up and change pitch accordingly, so everything seems to work as intended with this. However, the freestyle camera completely ignores the wall when you adjust the camera location directly. I figured the spring arm component was doing the actual collision, and so changed the code to adjust the spring arm’s location instead (leaving the player character behind). Now, when it interacts with the camera blocking volume it stalls the movement for half a second or so before continuing through the volume unhindered. Oddly, only the first interface it contacts interacts with the camera at all; if you move through the volume and then attempt to move back through it, the camera will pass clean through the back wall of the volume and stall at the first wall it contacted. I tried to surf the web for troubleshooting but nothing I found helped (mostly revolved around making sure the right settings were checked but everything seemed to be in order).

I was wondering if anyone knew what interaction was happening here. It works fine for adjusting the spring arm length but adjusting its location only stalls it for a moment. I am contemplating changing the freestyle movement to be based on changing the spring arm length but that seems like an inelegant solution. Is anyone familiar with this issue or know a better way of implementing the freestyle camera? Any help would be appreciated!

(I’ve attached the blueprints that I’ve been using to control the camera for reference)

Hi man,

I know for sure that you can have a simple camera that work like the one in the editor.
The part that can be trycky is the moovement collision.
Basically you can make an actor, with inside a camera, but if you move it , he will pass throught walls.
Because of the collisions i think.
You have to add a sphere with collision, as 1° thing in the actor, and move the cube with move actor and sweep, to make it work.

Or you can create some raycast on visibility before move in a direction, if you find an obstacle to the ray you can get the impact location and move until you make contact and no further.

Hi, thanks for the response!

I put a collision sphere at the end of the spring arm and had the camera inherit it, which allowed proper collision with the terrain and blocking volumes (as if it were an actor). The trouble is now that the sweep function seems to prohibit all movement if any part of the transform is caught by the sweep. Basically, if the camera runs into terrain it completely stops. I would rather have only the invalid direction stop and leave any other valid directions alone. For example, if the camera were to hit the floor at an angle, I would want it to stop movement in the Z direction and permit movement in the X and Y directions. I tried to do some raycasting when the sweep returned true, casting a ray in each direction to find which direction is invalid and then leaving that direction’s location unchanged. This works to some degree, but only once for each object the camera runs into. The raycast (linetracebysinglechannel) returns only the first hit against an object and that seems to be the cause of the problem. I can adjust some numbers to have the camera skip along different objects but once it hits twice on the same object it doesn’t work. I’m sure something like this can work since you can shoot an actor multiple times in first-person shooter style games, I’m just not sure how to implement it at the moment. I’ve attached some screenshots if anyone wants to take a look.