Gameplay
Physical surfaces, offroad and walls
Coming in 1.1
On this page
Two systems decide how the ground and the walls affect the Kart. Both are settings on the Kart, run inside the physics simulation and need no Blueprint logic. That is also why they work in multiplayer: every machine computes the same result.
- Surfaces: a different drag per ground type, for example offroad, mud or ice, read from the ground’s physical material.
- Walls: how much speed the Kart loses when it hits a wall, and whether it bounces off.
Surfaces
Each row of the Surface Properties list gives one physical surface type its own linear damping (drag). The higher the damping, the more the Kart is slowed down on that surface.
Every physics step, the Kart traces the ground below it and reads the surface type from the ground’s physical material. When a row matches, the Kart body uses that row’s damping. Ground without a matching row keeps the body’s own damping (the Linear Damping of the Kart’s Mesh component).
Surface settings
You find these in the Kart’s Class Defaults under Kart Base Settings > Surfaces.
| Setting | Default | What it does |
|---|---|---|
| Surface Properties | Empty | One row per surface type. Leave it empty to turn the feature off: the body’s own damping is then never touched. |
| Row: Surface Type | Default | The physical surface type this row applies to. |
| Row: Linear Damping | 0.05 | Drag of the Kart body on this surface. For example 0.05 for asphalt, 0.2 for mud. |
| Surface Detection Max Height | 150 | The ground must be within this distance (cm) below the Kart’s centre to count. Higher up, during jumps or off ledges, the Kart keeps the last surface it detected. |
Set up a surface
- Open Project Settings > Physics > Physical Surface and give a free slot a name, for example
SurfaceType1= Offroad. - In the Content Browser, right-click and create a Physical Material (Physics > Physical Material). Open it and set its Surface Type to the name from step 1.
- Give your ground that physical material:
- Landscape: select the Landscape actor and set Default Phys Material in the Details panel. To mix surfaces by painted layer, set the Phys Material of a layer’s Layer Info asset instead.
- Static meshes (roads, ramps): set Phys Material Override in the Collision section of the mesh component.
- Open
BP_KartPawn(or your child Blueprint), click Class Defaults and find Kart Base Settings > Surfaces. Add a row to Surface Properties, pick your surface type and set its Linear Damping. - Press Play and drive from the road onto the new surface.
A drag set from Blueprint with SetKartLinearDamping (an oil slick, a slow-down item) takes priority over the surface table. When it ends, the table applies again. See Boosts and items.
Read the surface for effects
Two read-only variables tell you what the simulation sees. Use them for dust colour, tyre sounds or skid marks.
| Variable | What it holds |
|---|---|
Current Surface Type (CurrentSurfaceType) | The surface type below the Kart. Works on other players’ Karts too. |
Current Linear Damping (CurrentLinearDamping) | The damping the simulation applied this tick, from a SetKartLinearDamping call or the surface table. -1 when the Kart leaves the body’s own damping untouched. Use it for your own Kart. |
To switch effects by surface, drag Current Surface Type into your Event Graph and connect it to a Switch on EPhysicalSurface node. Your surface names show up as its outputs.
If you change Surface Properties from Blueprint while the game runs, call ApplySurfaceProperties afterwards. The Kart reads the list at startup only.
The example project’s offroad
The example track uses exactly this setup:
- The project defines
SurfaceType1as Offroad. - The track’s offroad ground uses the physical material
PM_Offroad, which has the Offroad surface type. BP_KartPawnChild_Examplehas a Surface Properties row for Offroad.
Open the Class Defaults of BP_KartPawnChild_Example to see the value, and drive off the road to feel it.
Walls
Every physics step, the Kart looks at what its body touches. A contact counts as a wall when it is steep enough: with the default Wall Hit Max Normal Up Dot of 0.6, that means steeper than about 53°. Ground, ramps and jumps are not walls.
By default, on the step the body first touches a wall, the Kart keeps only a part of its horizontal speed. Vertical speed is untouched. Optionally it also gets pushed and turned away from the wall.
Another Kart is never a wall. Kart contacts have their own settings, see Kart-to-kart collisions.
Wall Hit settings
You find these in the Kart’s Class Defaults under Kart Base Settings > Wall Hit.
| Setting | Default | What it does |
|---|---|---|
| Slow Down On Wall Hit | On | Lose speed when hitting a wall. Off: no speed loss. The two bounce settings below still apply if they are above 0. |
| Wall Hit Speed Retention | 0.2 | Fraction of the horizontal speed the Kart keeps. 0.2 = it loses 80%. |
| Wall Hit Only On First Contact | On | On: the speed cut applies once when a wall contact begins, and again only after the Kart has left the wall and touches one again. Off: it applies on every physics step while the Kart touches a wall, so scraping along a wall stops you almost completely. |
| Wall Hit Max Normal Up Dot | 0.6 | How steep a surface must be to count as a wall. 0 = only perfectly vertical surfaces, 1 = every contact including the ground. |
| Wall Hit Bounce Speed | 0 | Extra push straight away from the wall when a contact begins, in cm/s. 0 = off. |
| Wall Hit Bounce Angular Speed | 0 | Extra turn away from the wall when a contact begins, in rad/s. Strongest for a glancing hit, none for a head-on one. 0 = off. |
Quick changes:
| You want | Change |
|---|---|
| Softer walls | Raise Wall Hit Speed Retention. |
| Bounce off walls | Set Wall Hit Bounce Speed and optionally Wall Hit Bounce Angular Speed above 0. |
| Scraping a wall slows you down hard | Turn off Wall Hit Only On First Contact. |
| Walls as plain physics | Turn off Slow Down On Wall Hit and keep both bounce settings at 0. |
React to a wall hit
The event On Kart Wall Hit (OnKartWallHit) fires at the moment a wall contact begins, on the server and on the owning player’s machine. It also fires when Slow Down On Wall Hit is off. Use it for sounds, particles, camera shake, or gameplay (behind Has Authority, for example to make the Kart drop an item).
| Parameter | What it holds |
|---|---|
| Wall Normal | Direction pointing from the wall toward the Kart. |
| Impact Speed | The Kart’s horizontal speed before the slow-down, in cm/s. |
Do not rely on it for other players’ Karts on your screen. For effects that must show on everyone’s screen, use the On Component Hit event of the Kart’s Mesh component. BP_KartPawn has both events, with a comment box that explains the wall hit.
While the Kart touches a wall, Is Touching Wall (bIsTouchingWall) is true. Like the event, it is meant for your own Kart, not for other players’ Karts.
Next steps
- Build oil slicks, mud items and boost pads in Boosts and items.
- Tune what happens when two Karts touch in Kart-to-kart collisions.
- Surfaces have no effect? Check Troubleshooting.
Not using the plugin yet? Get it on Fab.