is it possible to change that pressing T functionality into a Face detection system. I have a python script which will detects face and write a .json file with boolean Value
can i integrate that .json file into unreal engine? when face detected is true i want engine to access my microphone so i can give voice input
is it possible? how can i do that?
Yes, this is possible. In the sample setup, the T key triggers the talk state. You can replace that input event with your own event driven by the face-detected flag from your Python script.
When the value is true, call Start Talking. When it becomes false, call Stop Talking.
Please make sure you are calling Start Talking every frame while you want the microphone active. If it’s not being called continuously, the voice input will not be detected.
Since this type of customization falls outside our direct support scope, the exact implementation is up to you, but we recommend reviewing your update loop or event logic to ensure Start Talking is triggered as intended.
Path + flag mismatch
You’re passing an absolute path to Load Json from File while “Is Relative to Content Dir” is checked. That combo makes the load fail.
Gate logic not enforced Pressed goes straight to Start Talking even if no face is detected. The Enable Push to Talk bool isn’t actually gating the input.
Polling structure is brittle
The timer is fine, but the JSON read → bool extract → set variable path should live in a single function/event with a clean validity check.
Return value handling
Make sure the Return Value from Load Json from File is valid before calling Get Bool Field, or you’ll read stale/defaults.
Minimal, robust fix
File load
If you want an absolute path: uncheck “Is Relative to Content Dir”.
If you want a project-relative path: check the box and pass something like Data/json/face.json (and make sure the file is inside your Content folder or packaged appropriately).
Create a polling event
Make a Custom Event (or Function) called PollFaceJSON.
Inside it:
Load Json from File → Is Valid (on the returned VaRestJsonObject).
If valid: Get Bool Field with field name face_detected → Set Enable Push to Talk.
If not valid: Set Enable Push to Talk = false (and optionally Print String “JSON load failed”).
On BeginPlay (or where you currently do it), set a looping timer: Set Timer by Function Name
Object: self, Function Name: "PollFaceJSON", Time: 0.5–1.0, Looping: true.
Gate the input
From T Pressed → Branch with Enable Push to Talk as the Condition.
True: Start Talking
False: optional Print String “Face not detected”.
From T Released → Stop Talking.
Remove the direct wires from Pressed/Released to Start/Stop Talking that bypass the branch.
Keep the variable single-source
Only the polling event should SetEnable Push to Talk.
The input path should only Read it.
Debug quickly
After Get Bool Field, add Print String to show face_detected: true/false for a few cycles to confirm the read.
Optional hardening
If your JSON sometimes stores "face_detected": "true" (string), add a small parse step (get string and compare to "true"). Ideally, make it a real boolean in the file.
Consider switching to Set Timer by Event (bind to the PollFaceJSON event) to avoid typos in function names.
With those tweaks, “T” will only start voice when the JSON says a face is present, and the file will actually load.
Is it possible for you to share the Fae Detection code for the python script to test out?