Getting Started
Install and configure the PlayKit Unreal SDK
Getting Started
This guide walks you through installing and configuring the PlayKit SDK in your Unreal Engine project.
Installation
Download the Plugin
- Download the latest PlayKitSDK plugin from the PlayKit Dashboard
- Extract the plugin to your project's
Pluginsfolder:
YourProject/
├── Content/
├── Source/
└── Plugins/
└── PlayKitSDK/
├── Content/
├── Resources/
├── Source/
└── PlayKitSDK.uplugin- Restart Unreal Editor if it's already running
Enable the Plugin
- Open your project in Unreal Editor
- Go to Edit > Plugins
- Search for "PlayKit"
- Enable the PlayKitSDK plugin
- Restart the editor when prompted
Configuration
Project Settings
- Go to Edit > Project Settings
- Navigate to Plugins > PlayKit SDK
- Configure the following settings:
| Setting | Description |
|---|---|
| Game ID | Your application ID from PlayKit Dashboard |
| Developer Token | Your developer token (for development only) |
| Base URL | API endpoint (default: https://api.playkit.ai) |
| Default Chat Model | Default model for text generation |
| Default Image Model | Default model for image generation |
Remember to clear the Developer Token before shipping your game. Use Player Authentication in production.
Quick Start
Blueprint Example
Create a simple AI chat in Blueprints:
- Create a new Blueprint Actor
- Add the following nodes in the Event Graph:
Event BeginPlay
�?Create Chat Client (PlayKit|Factory)
�?Store result in variable "ChatClient"- To send a message and get a response:
ChatClient �?Chat (Message: "Hello, who are you?")
�?On Success �?Print String (Response Text)C++ Example
#include "Client/PlayKitChatClient.h"
// In Actor header — add UPlayKitChatClient as a component in the editor,
// or declare it as UPROPERTY(VisibleAnywhere):
UPROPERTY(VisibleAnywhere)
UPlayKitChatClient* ChatClient;
void AMyActor::BeginPlay()
{
Super::BeginPlay();
// UPlayKitChatClient is an ActorComponent — find it on this Actor.
ChatClient = FindComponentByClass<UPlayKitChatClient>();
// Bind the response event
ChatClient->OnChatResponse.AddDynamic(this, &AMyActor::HandleChatResponse);
// Set a system prompt and send a message
ChatClient->SystemPrompt = TEXT("You are a helpful assistant.");
ChatClient->GenerateText(TEXT("Hello, who are you?"));
}
void AMyActor::HandleChatResponse(const FPlayKitChatResponse& Response)
{
if (Response.bSuccess)
UE_LOG(LogTemp, Log, TEXT("AI Response: %s"), *Response.Content);
else
UE_LOG(LogTemp, Error, TEXT("Error: %s"), *Response.ErrorMessage);
}Verify Installation
To verify the SDK is correctly installed:
- Open a Blueprint
- Right-click in the Event Graph
- Search for "PlayKit"
- You should see categories like:
- PlayKit|Factory
- PlayKit|SDK
- PlayKit|Auth
- PlayKit|NPC
If you see these nodes, the SDK is installed correctly.
Example Content
The SDK includes example content in the Plugins/PlayKitSDK/Content/Examples folder:
- Login Example: Shows how to implement player authentication
- Chat Example: Demonstrates text generation and conversation
To use the examples:
- Enable "Show Plugin Content" in the Content Browser settings
- Navigate to
PlayKitSDK Content/Examples - Open the example maps to see working implementations
Troubleshooting
Plugin Not Showing
- Ensure the plugin folder structure is correct
- Check that
PlayKitSDK.upluginexists in the plugin root - Try regenerating project files (right-click .uproject > Generate Visual Studio Project Files)
Blueprint Nodes Not Found
- Verify the plugin is enabled in Edit > Plugins
- Restart the editor after enabling
- Check Output Log for any plugin loading errors
Authentication Errors
- Verify your Game ID is correct
- Ensure your Developer Token is valid (check expiration)
- Check network connectivity to the API endpoint
Next Steps
- Learn about Core Concepts to understand the SDK architecture
- Explore Text Generation for AI chat features
- See Image Generation for AI image creation