How to manage player pawn selection for a racing game?

Unfortunately, I can’t recall a tutorial right now that would directly point you to this sort of stuff but pretty much all of them at some point use this technique. In short, a blueprint approach to using base classes would be as follows:

  1. Start by creating a base BP class based on WheeledVehicle. Let’s Call this MyBaseVehicle.

  2. Go to this MyBaseVehicle and implement all the shared logics, such as input handling and movement.

  3. Create a new BP class for your vehicle but this time based it on MyBaseVehicle. That is, when you right-click in content browser > Blueprint class, search for MyBaseVehicle and you will be able to select it as parent. Let’s name it MyChildVehicle.

  4. Open it, add a mesh, set up the animation and tune that specific vehicle’s movement parameters such as speed, torque, etc. (If all your vehicles will have the same rigging structure, you might even want to do the Vehicle setup > Wheels Setup in the BaseClass. Overall, if you see that you’re adding and repeating a same thing for every single instance, then you should consider doing that in your Base class.

  5. Now drag your MyChildVehicle blueprint into the level and set the Player 0 to take control of it. You’ll see that you’ll be able to control this even though you implemented all the input handling in MyBaseVehicle blueprint.

  6. Create as many vehicles as you want and set them all to inherit from MyBaseVehicle. You can easily control each one of them without having to reimplement movement handling for them over and over again.

You can also refer to my other answer in here where I explain the proper usage of inherits and polymorphism to handle AI attack based on a single parent base class.

Hope this clarifies it :wink: