To create a vehicle mod, press the “Create Mod” button, and select “Create New Mod”
It is recommended to name this component so that it is easy to understand which Actor it will affect, and in what way. For this example, the name BP_PirateBikeMod is used, as the mod is adding a simple pirate flag to the bike.
After this component has been created it needs to be assigned in the ModRegistry:
Once this entry has been added, a simple modification (adding a flag static mesh and an appropriate material) is done inside the BP_PirateBikeMod->BeginPlay event.
To verify the results, bike can be spawned during a PIE session using the /bike#1 chat-code
Besides this simple mod, visuals and behavior can be modified using the following BP functions. (all these features are used in BP_AmphibianUAZ which is a part of ExampleMod).
Important: Some functions and properties are often similarly named to the ones that are not related to modding. Always assure that you are using a proper one. All ModKit-compatible functions will be in the “ModKit” category, as shown below:
There are some exceptions, when a function is a member of a vehicle blueprint base class (BP_SFPSVehicle), but those will be marked with * in the list below.
SetDrivingParametersForSurfaceType - Modifies vehicle driving parameters for a specific surface (Ground, Water, None)
SetVehicleTraceSettings - Modifies line-tracing settings for the vehicle, used to detect if the vehicle is on a valid driving surface
SetVehiclePhysicsSettings - Modifies vehicle physics simulation properties, like Mass, floating capability, drag coefficients, etc.
SetReceivesWaterDamage - Defines if a vehicle is receiving damage when submerged
SetMaxDurability - Defines maximum durability of the vehicle (HP)
AddVisibleStaticMesh - Adds a static mesh and properly attaches it to the vehicle body. Returns an Object Reference of the attached static mesh, so it can be used further as an input for other functions.
AddEngineSpinningComponents - Adds a static mesh to the list of components that need to be rotated based on the engine RPM and the specified local rotation Axis.
ToggleComponentVisibilityRPM - Defines an RPM at which a specific component’s visibility toggles (useful for wheels and propellers, which can be replaced with a “blurry” version after a certain RPM). An example of this function can be found in BP_AmphibianUAZ->AddPropeller Blueprint event
*BP_SFPSVehicle->ApplyPaintMaterials - Overrides vehicle paint materials at the specific slots
Deadside vehicles support three types of suspensions: axle (dependent), fork and swing arm. Those can be added using the following functions. It is important to note that in addition to suspensions, suspended wheels should be added too, and assigned with a proper index.
AddAxleSuspension - Adds dependent axle suspension to the vehicle
AddForkSuspension - Adds for suspension to the vehicle
AddSwingArmSuspension - Adds swing arms suspension to the vehicle
AddSuspendedWheelDefinition - Defines a suspended wheel that is attached to a given suspension, based on its Index, Origin, Rotation, Radius and Travel
An example of these steps can be found in BP_AmphibianUAZ->AddAxleSuspension. Additionally, since suspensions are always added in blueprints, existing implementations can be seen in DefineSuspensionComponents of BP_SFPSVehicle_UAZ_Hunter, BP_SFPSVehicle_Ural_M6736 and BP_SFPSVehicle_Ural_M6736_Sidecar.
AddCustomSeat - Adds a new passenger seat at the specified location and rotation, using the data from SeatInfo struct. SeatInfo->AnimationClassOverride and SeatInfo->AnimationSeatIndexOverride are used to mimic the occupant character seating behavior from other vehicles. In BP_AmphibianUAZ, sidecarts seats attached to the top are mimicking the behavior defined in BP_SFPSVehicle_Ural_M6736_Sidecar.
Seating transform defines the position and rotation of the character.
Exit transform defines the position and rotation the character will assume after leaving the seat.
Movement colliders of vehicles are split in two categories:
AddSimpleCollisionMesh - Adds an invisible “simple collision mesh” that should approximately match the newly added visible meshes (if collisions are required).
AddSimulationCapsule - Adds a capsule collider used to approximate the volume of the newly added visible meshes (if collisions are required).
An example of custom seats can be seen in BP_AmphibianUAZ->AddSidecarRight and BP_AmphibianUAZ->AddSidecarLeft Blueprint events.