Set Up The Scene¶
FPhysics3DManager¶
For your first step, you will create a FPhysics3DManager. Right-Click in the Hierarchy window and select SocketWeaver->FPhysics->3D->Physics Controller. Make sure to disable Auto Initialize and Auto Update.
Rigidbodies¶
Next, you will create the following Rigidbodies.
| Name | Body Type | Description |
|---|---|---|
| Ball | Dynamic | Controlled by physics |
| Cars | Dynamic | Controlled by players |
| Arena | Static | Does not move |
| Goals | Static | Do not move |
Arena¶
- Download the assets from our github repository.
- Drag the
Arena3D model to theSoccerGamescene. - Move the
Arenato (0, 0, 0). - Add a
FMeshCollider3Dcomponent to theArena. AFTransformcomponent should be automatically added. - Add a
FRigidbody3Dcomponent to theArenaand set itsBody TypetoStatic.
Ball¶
- Select
SocketWeaver->FPhysics->3D->Sphere. - Select the sphere and name it
Ball. - Move the
Ballto (75, 1.5, 50). - Set its scale to (3, 3, 3).
- Select the
FSphereCollidercomponent. - Set
Bouncinessto 0.5. - Enable
Override Massand setCustom Massto 0.1.
Cars¶
- In the FPhysics3D samples folder, select the
Carprefab atSamples->3D->Scripts->Vehicle->SimpleRaycast. - Drag it to the
SoccerGamescene. - Select the
Carin the Hierarchy, right click and selectPrefab->Unpack Completely. - Move the
Carto (85, 0.6, 50). - Rotate the
Carto (0, -90, 0).
Goals¶
- Select
SocketWeaver->FPhysics->3D->Cube. - Select the cue and name it
Goal. - Move the
Goalto (-8.4, 6, 50). - Set its scale to (10, 12, 34).
- Select the
FRigidbody3Dof theGoaland setBodyTypetoStatic. - Select the
FBoxCollider3Dof theGoaland enableIs Trigger.
Final Touch¶
In the asset folder, we included the prototype textures pack from Kenney. You can select the textures you like and assign them to the materials of the Arena and the Ball.
The scene should look like.

Test¶
Hit Play, you should be control the car using the WASD keys.
