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.
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.
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.