How do I switch camera view for another actor?

I have a blueprint class MyCar (inherited from Actor), which has three camera components in it. I spawned three MyCar actors.

I tried switching camera from car 1 to car 2 by calling SetViewTargetWithBlend, but it does not work, although after checking the log I am sure this function has been called in blueprint. It is always car 2 that is displayed on screen.

If they were pawns, I could do this using Possess and Unpossess. But now they are actors. I don’t know how to switch the camera.

This will switch between 3 separate actors (each object has 3 cameras):

How are you selecting the objects to switch to?

Thank you very much! It works fine.

Thanks for the answers. It was my fault (I forgot to link some nodes). I should have removed this “false” question, but the answers below are really helpful, especially for us beginners.

Thx for the help, but how to control the camera after the switching, it does not respond to the Input events.

it does not respond to the Input
events.

And it shouldn’t.

What do you mean by control the camera? You generally don’t control a camera, you control the actor the camera is attached to.


If you have a more complex setup where you have 1 camera only but many actors (with no cameras), I’d create a separate Pawn with a camera and then attach it to anything the camera needs to follow. This way this camera pawn always has the same input.

What’s more, in this case you wouldn’t even need to Set View Target, but SnapTo Attach the entire camera actor to a target entity instead.