How to switch to another camera component without deactivating others?

I have multiple camera components in an actor. How can I switch to a different camera component within an actor, without deactivating other camera components?

There is an answer that deals with this by deactivating all other camera components within the actor. Switching between multiple cameras within the Character. - Cinematics & Media - Epic Developer Community Forums

Unfortunately, this is not the solution I expect, because I need all camera components activated (they are bound to other widgets, like minimaps or car rearviews).

For example, I have two camera components, one for front view (main), and one for rear view. When I start the game, the rear view is displayed on screen, whereas the front view is expected. I have no idea how to switch to the front camera to display on screen. Thank you very much!

250961-4.png

Do you need to just switch between the components or do you want to switch between them and have the Set View Target With Blend do the interpolation as well?

edit: Let me clarify - Set View Target With Blend is only good for switching between actors - the camera component & actor interaction is pretty dumbed-down so you won’t be able to achieve the desired behaviour in blueprints only.

If you want to smoothly switch between camera components withing the same actor, interpolating location between previously set anchor points is a much better solution.

Thank you for your clarification. I don’t need the “with blend” feature, i.e., I don’t need a smooth switch. I just need to switch. But the only way I’ve found so far to switch camera components within an actor, is to deactivate other camera components in the actor.

My question is, is there another way to do so without deactivating others? I raise this question because I need other camera components for other purposes, so I should not deactivate them.

By the way, I skipped this and worked it around by using a separate Camera Actor attached to the actor, instead of using a Camera Component. This works, but not so convenience as using a component.

You will not be able to achieve what you want because of how actors calculate which camera component is Active. Set View node just queries the actor and gets the first active camera (a bit of a mystery how this is calculated, I need to find it in c++, perhaps it’s small fix).

So no, you can’t do it, not in pure blueprints. Especially that you need the rear cam active at all times.

By the way, I skipped this and worked
it around by using a separate Camera
Actor attached to the actor, instead
of using a Camera Component. This
works, but not so convenience as using
a component.

If you mean a Child Actor Component, then that’d be the bast way to go about it as they spawn and destroy actors automatically. That would be elegant enough for most cases.

2 Likes

If you mean a Child Actor Component

I mean a Camera Actor. I create a Spring Arm component in my Car actor, and then attach the Camera Actor to the Spring Arm component by using “Attach To Component” in blueprint. This works as expected.

Thank you very much for your answer! You save me a lot of time by directly answering no. Thank you

I see. If you’re still not fed up with setting this up, do consider Child Actor Components. You set them up as components of the car (just like cameras, with positions, rotation and offsets) and choose an actor class for them to use. You already have a camera actor, so you can use that.

This way you do not have to spawn or attach anything. They essentially turn actors into components.

Good luck with the rest!

1 Like

I’ll try your suggestions and see which approach seems best. Child Actor Component seems powerful. Thank you