This commit is contained in:
Arnaud Jamin
2024-01-12 09:33:42 -05:00
+14
View File
@@ -375,7 +375,19 @@ void ACogSampleGameState::BeginPlay()
- Tick the CogWindowManager: - Tick the CogWindowManager:
```cpp ```cpp
// ACogSampleGameState.cpp // ACogSampleGameState.cpp
ACogSampleGameState::ACogSampleGameState(const FObjectInitializer & ObjectInitializer)
: Super(ObjectInitializer)
{
// Enable ticking
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.SetTickFunctionEnable(true);
PrimaryActorTick.bStartWithTickEnabled = true;
[...]
}
void ACogSampleGameState::Tick(float DeltaSeconds) void ACogSampleGameState::Tick(float DeltaSeconds)
{ {
Super::Tick(DeltaSeconds); Super::Tick(DeltaSeconds);
@@ -386,6 +398,8 @@ void ACogSampleGameState::Tick(float DeltaSeconds)
} }
``` ```
- In your PlayerController class, spawn the Cog Replicators. The Replicator are used to communicate between the client and the server, for example to apply cheats, spawn actors, etc. - In your PlayerController class, spawn the Cog Replicators. The Replicator are used to communicate between the client and the server, for example to apply cheats, spawn actors, etc.
```cpp ```cpp
void ACogSamplePlayerController::BeginPlay() void ACogSamplePlayerController::BeginPlay()