Vision quick start
Add scene vision to a Convai character Blueprint and verify that captured frames affect the character's response in Play In Editor.
We will add an Environment Webcam component to an existing Convai character, assign a render target, and start capture from Event BeginPlay. At the end, the character should respond to something visible in front of the capture component during Play In Editor.
Prerequisites
The Convai Unreal Engine plugin version 4.0.0-beta.27 is installed and enabled. See Install the plugin if needed.
Your API key is configured. See Configure the API key.
Your level has a character with a Convai Chatbot component (
UConvaiChatbotComponent) and a validCharacterID. See Add your first Convai character if you have not completed that setup.A Convai Player component (
UConvaiPlayerComponent) is present so you can start a conversation in Play In Editor.
Create a render target asset
In the Content Browser, right-click in an empty area, open the Convai submenu, and choose Vision Render Target (the context menu label in the current plugin build). Name the asset, for example RT_ConvaiVision, and save it.
The Convai render target action creates a UTextureRenderTarget2D with RTF_RGBA8, a black clear color, and a default size of 512 x 512.
Verify vision is working
Place a distinct object in front of Environment Webcam. Enter Play In Editor, start a conversation, and ask about that object, such as its color or location.
Check these signals in order:
On the Convai Chatbot component, call Supports Vision. It should return
true.On Environment Webcam, call Get State. It should return
Capturing.Open the render target asset in the Content Browser while Play In Editor is running. The preview should show scene content, not a blank image.
In the Output Log, look for
SendImage: Sending raw imagefromConvaiChatbotComponentLog.
If any check fails, see Troubleshoot vision.
Next steps
Vision frame sourcesVision usage examplesHow vision worksLast updated
Was this helpful?