Skip to content

Commit b2ba5bd

Browse files
Merging final GDK for Unreal 0.12.0 release
Release 0.12.0
2 parents d383ce3 + ff9ef48 commit b2ba5bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1666
-464
lines changed

.buildkite/nightly.definition.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ github:
77
teams:
88
- name: Everyone
99
permission: BUILD_AND_READ
10-
- name: gbu/develop/unreal
10+
- name: gen/team/unreal
1111
permission: MANAGE_BUILD_AND_READ

.buildkite/nightly.steps.yaml

+14-23
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ script_runner: &script_runner
2121
- "machine_type=quarter"
2222
- "permission_set=builder"
2323
- "platform=linux"
24-
- "queue=${CI_LINUX_BUILDER_QUEUE:-v4-2019-12-12-bk5225-daecba805768d787}"
24+
- "queue=${CI_LINUX_BUILDER_QUEUE:-v4-20-08-12-083656-bk14222-38697241}"
2525
- "scaler_version=2"
2626
- "working_hours_time_zone=london"
2727
retry:
@@ -30,27 +30,14 @@ script_runner: &script_runner
3030
- <<: *bk_system_error
3131
- <<: *bk_interrupted_by_signal
3232

33-
windows: &windows
34-
agents:
35-
- "agent_count=1"
36-
- "capable_of_building=gdk-for-unreal"
37-
- "environment=production"
38-
- "machine_type=quad"
39-
- "permission_set=builder"
40-
- "platform=windows"
41-
- "scaler_version=2"
42-
- "queue=${CI_WINDOWS_BUILDER_QUEUE:-v4-20-03-26-102432-bk9951-8afe0ffb}"
43-
timeout_in_minutes: 60
44-
retry:
45-
automatic:
46-
- <<: *agent_transients
47-
- <<: *bk_system_error
48-
- <<: *bk_interrupted_by_signal
49-
plugins:
50-
- ca-johnson/taskkill#v4.1: ~
51-
5233
# NOTE: step labels turn into commit-status names like {org}/{repo}/{pipeline}/{step-label}, lower-case and hyphenated.
5334
# These are then relied on to have stable names by other things, so once named, please beware renaming has consequences.
35+
env:
36+
SLACK_CHANNEL: "#unreal-gdk-builds"
37+
GDK_REPOSITORY: "git@github.com:spatialos/UnrealGDK.git"
38+
MAIN_MAP_NAME: "Control_Small"
39+
SPATIAL_PROJECT_NAME: "unreal_gdk"
40+
SPATIAL_RUNTIME_VERSION: "15.0.0" ## the runtime version of SpatialOS
5441

5542
steps:
5643
- label: "generate-pipeline-steps"
@@ -64,6 +51,10 @@ steps:
6451
- wait
6552

6653
- label: "slack-notify"
67-
if: build.env("SLACK_NOTIFY") == "true" || build.branch == "master"
68-
command: "powershell -NoProfile -NonInteractive -InputFormat Text -Command ./ci/slack-notify.ps1"
69-
<<: *windows
54+
if: |
55+
build.env("NIGHTLY_BUILD") == "true" ||
56+
build.env("SLACK_NOTIFY") == "true" ||
57+
build.env("FIREBASE_TEST") == "true" ||
58+
build.branch == "master"
59+
command: "python3 ci/slack-notify.py"
60+
<<: *script_runner

DeployGame.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set deploymentname=%gamename%%formatdate%
1414
cd spatial/
1515
spatial build build-config || goto :error
1616
spatial cloud upload %deploymentname% --force || goto :error
17-
spatial cloud launch %deploymentname% one_worker_test.json %deploymentname% --snapshot=snapshots/default.snapshot --cluster_region=eu --runtime_version=0.4.3 || goto :error
17+
spatial cloud launch %deploymentname% one_worker_test.json %deploymentname% --snapshot=snapshots/default.snapshot --cluster_region=eu --runtime_version=15.0.0 || goto :error
1818
spatial project deployment tags add %deploymentname% dev_login || goto :error
1919
spatial project deployment tags add %deploymentname% status_lobby || goto :error
2020

Game/Config/DefaultEngine.ini

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ GlobalDefaultServerGameMode=None
77
ServerDefaultMap=/Game/Maps/Control_Small.Control_Small
88

99
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
10-
MinimumiOSVersion=IOS_11
10+
MinimumiOSVersion=IOS_12
1111

1212
[/Script/HardwareTargeting.HardwareTargetingSettings]
1313
TargetedHardwareClass=Desktop
@@ -16,8 +16,6 @@ DefaultGraphicsPerformance=Maximum
1616
AppliedDefaultGraphicsPerformance=Maximum
1717

1818
[/Script/Engine.RendererSettings]
19-
r.Streaming.PoolSize=2000
20-
r.SceneColorFormat=2
2119
r.TemporalAACurrentFrameWeight=0.25
2220
r.AllowStaticLighting=False
2321
r.LightPropagationVolume = 1
@@ -105,7 +103,8 @@ AsyncPut=(Type=AsyncPut, Inner=Hierarchy)
105103
Hierarchy=(Type=Hierarchical, Inner=Boot, Inner=Pak, Inner=EnginePak, Inner=Local, Inner=Shared)
106104
Boot=(Type=Boot, Filename=%GAMEDIR%DerivedDataCache/Boot.ddc, MaxCacheSize=256)
107105
Local=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, PurgeTransient=true, DeleteUnused=true, UnusedFileAge=17, FoldersToClean=-1, Path=../../../Engine/DerivedDataCache)
108-
Shared=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19, FoldersToClean=-1, Path=\\mystudio.net\DDC, EnvPathOverride=UE-SharedDataCachePath)
109-
AltShared=(Type=FileSystem, ReadOnly=true, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19, FoldersToClean=-1, Path=\\mystudio.net\DDC2, EnvPathOverride=UE-SharedDataCachePath2)
110106
Pak=(Type=ReadPak, Filename=%GAMEDIR%DerivedDataCache/DDC.ddp)
111107
EnginePak=(Type=ReadPak, Filename=../../../Engine/DerivedDataCache/DDC.ddp)
108+
; Shared DDC location setup
109+
; Shared=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19, FoldersToClean=-1, Path=\\mystudio.net\DDC, EnvPathOverride=UE-SharedDataCachePath)
110+
; AltShared=(Type=FileSystem, ReadOnly=true, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19, FoldersToClean=-1, Path=\\mystudio.net\DDC2, EnvPathOverride=UE-SharedDataCachePath2)

Game/Config/DefaultInput.ini

+54-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11

22
[/Script/Engine.InputSettings]
3-
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
4-
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
5-
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
6-
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
7-
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
8-
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
93
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
104
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
115
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
@@ -53,13 +47,61 @@
5347
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_MiddleGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
5448
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_RingGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
5549
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_PinkyGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
50+
+AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
51+
+AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
52+
+AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
53+
+AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
54+
+AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
55+
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
56+
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
57+
+AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
58+
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
59+
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
60+
+AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
61+
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
62+
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
63+
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
64+
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
65+
+AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
66+
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
67+
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
68+
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
69+
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
70+
+AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
71+
+AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
72+
+AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
73+
+AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
74+
+AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
75+
+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
76+
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
77+
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
78+
+AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
79+
+AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
80+
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
81+
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
82+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
83+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
84+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
85+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
86+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
87+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
88+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
89+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
90+
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Touch",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
91+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
92+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
93+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
94+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
95+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
96+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
97+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
98+
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
5699
bAltEnterTogglesFullscreen=True
57100
bF11TogglesFullscreen=True
58101
bUseMouseForTouch=False
59102
bEnableMouseSmoothing=True
60103
bEnableFOVScaling=True
61104
bCaptureMouseOnLaunch=False
62-
bDefaultViewportMouseLock=False
63105
bAlwaysShowTouchInterface=False
64106
bShowConsoleOnFourFingerTap=True
65107
bEnableGestureRecognizer=False
@@ -94,6 +136,10 @@ DoubleClickTime=0.200000
94136
+ActionMappings=(ActionName="ScrollDown",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=MouseScrollDown)
95137
+ActionMappings=(ActionName="QuickToggle",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Q)
96138
+ActionMappings=(ActionName="ToggleMode",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=X)
139+
+ActionMappings=(ActionName="Primary",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_RightTrigger)
140+
+ActionMappings=(ActionName="Secondary",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_LeftTrigger)
141+
+ActionMappings=(ActionName="Crouch",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Right)
142+
+ActionMappings=(ActionName="Sprint",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Top)
97143
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W)
98144
+AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S)
99145
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=Up)
@@ -110,9 +156,7 @@ DoubleClickTime=0.200000
110156
+AxisMappings=(AxisName="LookUp",Scale=-1.000000,Key=MouseY)
111157
+AxisMappings=(AxisName="MouseHorizontal",Scale=1.000000,Key=MouseX)
112158
+AxisMappings=(AxisName="MouseVertical",Scale=1.000000,Key=MouseY)
113-
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
114-
ConsoleKey=None
115-
-ConsoleKeys=Tilde
159+
DefaultTouchInterface=None
116160
+ConsoleKeys=Tilde
117161

118162

Binary file not shown.
432 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 KB
Binary file not shown.
16.2 KB
Binary file not shown.
30 KB
Binary file not shown.
16.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
17.2 KB
Binary file not shown.

Game/Source/GDKShooter/GDKShooter.Build.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ public GDKShooter(ReadOnlyTargetRules Target) : base(Target)
2424
"Slate",
2525
"SlateCore",
2626
"SpatialGDK",
27-
"Json",
28-
"HTTP",
29-
"AIModule"
27+
"Json",
28+
"HTTP",
29+
"AIModule",
30+
"ApplicationCore"
3031
});
3132
}
3233
}

Game/Source/GDKShooter/Private/Characters/GDKCharacter.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,8 @@ bool AGDKCharacter::CanBeSeenFrom(const FVector& ObserverLocation, FVector& OutS
209209
OutSightStrength = (float)PositiveHits / (float)NumberOfLoSChecksPerformed;
210210
return PositiveHits > 0;
211211
}
212+
213+
void AGDKCharacter::ClientMovementReset_Implementation()
214+
{
215+
GetCharacterMovement()->ResetPredictionData_Server();
216+
}

Game/Source/GDKShooter/Private/Controllers/GDKPlayerController.cpp

+21-3
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,38 @@
44

55
#include "Blueprint/UserWidget.h"
66
#include "Camera/CameraComponent.h"
7-
#include "Controllers/Components/ControllerEventsComponent.h"
87
#include "Characters/Components/EquippedComponent.h"
98
#include "Characters/Components/HealthComponent.h"
109
#include "Characters/Components/MetaDataComponent.h"
10+
#include "Controllers/Components/ControllerEventsComponent.h"
1111
#include "EngineClasses/SpatialNetDriver.h"
12-
#include "Interop/Connection/SpatialWorkerConnection.h"
12+
#include "Game/Components/PlayerPublisher.h"
1313
#include "Game/Components/ScorePublisher.h"
1414
#include "Game/Components/SpawnRequestPublisher.h"
15-
#include "Game/Components/PlayerPublisher.h"
1615
#include "GameFramework/Character.h"
1716
#include "GameFramework/GameStateBase.h"
1817
#include "GameFramework/PlayerState.h"
1918
#include "GameFramework/SpringArmComponent.h"
2019
#include "GameFramework/TouchInterface.h"
20+
#include "Interop/Connection/SpatialWorkerConnection.h"
2121
#include "Net/UnrealNetwork.h"
22+
#include "UI/TouchControls.h"
2223
#include "Weapons/Holdable.h"
2324
#include "Weapons/Projectile.h"
2425
#include "Weapons/Weapon.h"
26+
#include "Widgets/Input/SVirtualJoystick.h"
2527

2628

2729
AGDKPlayerController::AGDKPlayerController()
2830
: bIgnoreActionInput(false)
2931
, DeleteCharacterDelay(5.0f)
3032
{
33+
static ConstructorHelpers::FClassFinder<UTouchControls> TouchUIFinder(TEXT("/Game/UI/TouchControls/BP_TouchControls"));
34+
if (TouchUIFinder.Class != nullptr)
35+
{
36+
wTouchUI = TouchUIFinder.Class;
37+
}
38+
3139
// Don't automatically switch the camera view when the pawn changes, to avoid weird camera jumps when a character dies.
3240
bAutoManageActiveCameraTarget = false;
3341

@@ -63,6 +71,16 @@ void AGDKPlayerController::SetPawn(APawn* InPawn)
6371
SetViewTarget(InPawn);
6472
// Make the new pawn's camera this controller's camera.
6573
this->ClientSetRotation(InPawn->GetActorRotation(), true);
74+
if (SVirtualJoystick::ShouldDisplayTouchInterface() && wTouchUI != nullptr)
75+
{
76+
TouchUI = CreateWidget<UTouchControls>(this, wTouchUI);
77+
if (TouchUI)
78+
{
79+
TouchUI->AddToViewport();
80+
TouchUI->BindControls();
81+
}
82+
}
83+
6684
}
6785
else
6886
{

0 commit comments

Comments
 (0)