Follow the steps below to create your very own physics-enabled soccer game, where players use their pickaxe to get the ball into their opponents' goal:
Set Up the Project
Create a new project from any island template.
The Blank template is recommended if you want to ensure a flat area to work with.
If you start with the Blank template, apply the M_FortniteLandscape_Customizable material to the GridPlanes to give the ground a grassy look.
From the Project dropdown in the menu bar, select Project Settings.
Scroll to the bottom, under Experimental Access, to find and enable the Physics checkbox.
Import the Soccer Ball
Download a soccer ball asset from your preferred asset marketplace. In this example, a .glb asset is used. It contains a static mesh, texture and material instance.
Soccer Ball by tinmanjuggernaut on Sketchfab, used under the Sketchfab Standard License.
Import the ball by dragging the .glb file into your Content Browser. You can leave the default settings.
Double-click the static mesh to open the asset for editing.
In the viewport, select Show and check Simple Collision.
If there is collision already, delete it.
From the Collision menu in the top ribbon, select Add Sphere Simplified Collision.
In the Collision settings of the Details panel, set:
Radius - 102.0
Collision Preset - Block All
Center - 0 on all axes
The collision should now be visible. Save your static mesh.
Create the Soccer Ball Prop
In the Content Browser, right-click the static mesh and select Scripted Asset Actions > Convert to Prop > Stone.
A folder called CustomProps will be created in your project. Open the folder and drag the Blueprint prop into the scene.
In the Details panel, press the +Add button and add a Fort Physics component.
On the FortPhysics component, set:
Simulate Physics - True
Override Mass - True
Mass - 20.0
Linear Dampening - 0.1
Angular Dampening - 0.3
Impulse On Hit Multiplier - 3.0
Add Soccer Game Elements
Select IslandSettings0 in your Outliner and change the following settings:
Max Players - 6
Teams - Team Index: 2
Team Size - Split Evenly
Join In Progress - Spawn
Invincibility - True
Allow Building - None
Start With Pickaxe - True
Place six Player Spawner devices:
First 3: Player Team - Team Index 1
Other 3: Player Team - Team Index 2
Visible in Game - False
Try launching a session at this point to make sure everything works as intended.
Using props, build out your field!
Use Colossal Coliseum in Fortnite > Prefabs
Use Recreation Soccer Field as your pitch
Find the FortniteRecreation SoccerGoal in the Content Browser and place two instances for your goal areas. Scale them up 1.5x to accommodate the size of the ball.
Add a Barrier device to enclose the field and keep the ball from flying out of bounds.
Change the Zone Shape to Hollow Box, and put the bottom of the device below the ground. Otherwise, it will interfere with the player spawners.
If you are spawning in skydiving and not on the Player Spawn Pad, it could be that the bottom of the device needs to be lowered, or that the Zone Shape isn’t set to Hollow Box.
Set Up Devices
Currently, the devices that work with Physics are all located in the Fortnite > Devices > !Experimental folder.
To detect goals, set up two Volume devices:
Name the volume device behind the Team 1 spawn pads Team_A_Goal.
Name the volume device behind the Team 2 spawn pads Team_B_Goal.
Size Settings Width - 0.6
Depth - 2.2
Height - 1.0
Add a Tracker device:
Name - Tracker Score Team A
Stat to Track - Score
Tracker Title - Team A Score
Sharing - Team
Duplicate the Tracker device and rename the copy to Tracker Score Team B. Change the Tracker Title to Team B Score.
Add a HUD Message device:
Name - HUD Message Device Score A
Play Sound - Scoring_Point_Added_Cue
Background - Pick a color
Placement - Custom
Screen Anchor - Center
Message - “Team A Goal!!!”
Duplicate the HUD Message device.
Name - HUD Message Device Score B
Message - “Team B Goal!!!”
Background - Pick a second color
Add two Air Vent devices at an angle next to the goal. When the ball hits either of these air vents, it will launch the ball away from the goal area. Set Knockup Force Multiplier to 0.1.
Make a Game Manager Using Verse
Using Verse is the quickest and simplest way to manage your game, so let's create a Game Manager! For more information on how to create a Verse device, check out Create Your Own Device Using Verse.
Create a new Verse file and name it game_manager.verse. Double-click the file to open it in VS Code.
Add the following code to the file:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
# A Verse-authored creative device that can be placed in a level
game_manager := class(creative_device):
Compile the code and save your project.
You may need to tweak the positions of hiding and resetting the ball.
In UEFN, place the Verse device you just created in the scene and connect all the editable variables to your devices.
Start a session or push all changes to the Live Edit session and verify:
The ball is moving when you push into it or hit it with the pickaxe.
When you push the ball into the goal, a HUD message pops up, the score changes, and the ball resets to the center of the field.
Enjoy your new soccer game!
Experiment by adding more balls, more devices, changing the scale, etc.! Here's an example of a modified soccer game: