Is it ok to attach camera to every pawn?

Thanks, that makes sense.

Hi, in my game I want to implement similar to GTA feature - a player can enter/exit vehicles and control them. At this point my solution is to add a camera to every pawn. When the player enters a vehicle I would just switch the camera from one pawn (Character) to another (WheeledVehicle). Is that ok solution? That way if there are 100 vehicles on a level it means, that there is the same amount of cameras (They are just deactivated).

Does that somehow affect performance? What if I add a springarmcomponent to each camera?
I am going to try to have only one camera which is some how attached to player controller. And attach it to a new vehicle pawn each time the player changes cars. Not sure if that is going to work, though.

Hello,

Either approach work. You could use 1 or 2 cameras, and move them constantly VS if you give every object a camera and swap camera’s regularly.

More objects in your world means increased memory (every object takes memory - but not a lot), however, as you begin building your game you should take the approach which makes making progress on building your game easiest.

No matter which approach you take, as long as you are consistent, if you find the approach to be troublesome in the long run it becomes easy to replace. You could even take steps (like creating a custom blueprint for these cameras) so that making changes to all of them is easy.

I would personally give every object that you would attach a camera to a Node to attach the camera to, and information about what sort of camera it should have, and take the fewer object approach. But it’s 100% personal preference. What’s important architecting everything in a way that is consistent.