How to implement map bounds for RTS Camera?

Hi, I’ve made an RTS Camera for my project. It’s able to do all the functions that I need except for having map bounds. I’m using a pawn blueprint for my camera, since I want the camera to be the default pawn. It has a capsule component at the base point of it’s spring arm which hangs around near the half height of a default human character. So in order to create bounds, I tried placing some static meshes with block all as walls. However my camera just passes though them without getting blocked even if I set it’c collision to ‘Block All’. Occasionally it gets blocked by parts of meshes, but most of the time it passes through. I’ve tried using blocking volumes, but yet again the capsule passes through it as if it was not there. Using component hit triggers, I can see it is overlapping with it. I was able to print strings when it entered the blocking volumes. However I’m unable to block the capsule. Is there something else that I need to add to set up the collision?

The keyword is probably collision channels. Look at this thread: Best way to add a block for RTS camera? - Blueprint - Unreal Engine Forums

For testing it out, I’ve already used BlockAll for collision on the capsule component as well as the blocking volume. I will try with only the invisible wall channel, but I do not understand why blockall fails to work. If I set it to overlap, I can see that it’s interacting because it print out a string. But nothing happens for Block. Is it some internal setting issue with pawn blueprints?

Stormrage!
You’re absolutely right. Blockall+ blockall = no blocking at all. Strange…
Okay I played around with this a little bit and got it working using a different approach. Here’s what I did:

  1. Goto Settings->Project settings->Collision->New Object channel.
  2. Create a new object channel named e.g. “MyChannel” and hit save all.
  3. Find you camera’s collision component and set collision channel to Custom…
  4. Set collision enabled to Collision enabled and the Object type the name of your newly created Object channel e.g “MyChannel”.
  5. Under trace and object responses set all of them to Ignore except for your new channel. Set this one to blocked.
  6. Create a Blocking volume and set it’s collision preset to the exact same custom preset as for your collidable camera target.

And…it works!

Cheers,
Isvulfe

You could checkout the Third Person template. Dropping additional Camera Blocking Volumes in there work with the default Camera channel.

You need to check the “Sweep” checkbox on “Set World Location”, otherwise the actor will move without collision checking.

Hi Isvulfe, I tried that in a new third person template with a pawn blueprint containing camera as the default character. The capsule that was at the end of the spring arm had collision setting set accordingly. There was a blocking volume in the level as well with similar settings. Unfortunately it didn’t work.

So I decided to try moving an actor blueprint instead of a pawn. At level start the actor starts moving toward the blocking volume. But it just passes through the volume as if there’s nothing over there. I’ve attached some screenshots of the settings that I’ve used:

And here’s a video of the actor just cruising through the blocking volume:

[DropBox: Video Link][4]

I’m somehow getting the feeling that I’m making some simple stupid mistake somewhere.

Hi ngrts, I’m not exactly trying to stop the camera. Just the capsule component at the end of the spring arm is better for me. I’ve tried using both types of blocking volumes, but with no success.

Thanks a lot man. :smiley: That did the trick.

Here is another way do “block” the camera

Just make 4 different box trigger one for every direction

Ps: Set your camera collision to overlap all

But how I create the camera bounds the camera having lag(for smooth moving) ?
I use the 2D Side-Scroller Blueprint Template/