Download

handle spectator camera map bounds

Hi,
I have multiple cameras (thirdperson, topdown) in my game and want to keep my camera in a certain area of the map, whether its following a character or not.
So there is this CameraBlockingVolume class, but as far as i understand it can only be used for cameras with SpringArm attached to it.

My approach would be to create a custom volume, that can handle all camera collisions and add a collision component to my cameras.
Do i have to create 4 volumes for the edges of the bounds or can i use one volume with the “Hollow” attribute enabled?

edit: Btw. Is it possible to generate hit events with camera components? I tried if enabled simulate physics and generate hit events but it didnt work.

So with enabled “hollow” i need only one volume. great!
I attached a collision sphere to my top down camera (no springarm, because its not linked to an character).
I have the same problem like other people that the collision sphere and the camera blocking volume generate overlap events but no hit events, even if have set all to block and enabled “generate hit event” + simulate physics.
My quick and dirty solution was to block camera movement in the direction that caused the overlap until it was moved in the opposite direction.

I wrote this in an other thread before:
I have still problems generating hit events for my topdown camera, which has no SpringarmComponent. I have created a CollsionComponent (ShapeComponent) as root of my TopDownCamera.
Overlapping works but i can only receive hit events if simulate physics is enabled.

Couldnt find any tutorial or solution for this special case yet. I dont even know if its possible to generate hit events (without physics) for childs, that are not static or skeletal meshes.

Edit: Solved! I used SetActorLocation() and SetActorTransform() to move the camera. The second parameter bSweep is false by default, but it must be true. So why the hell is this parameter false ?!
This makes no sense. When i enable blocking, it should trigger hit events by default.