big-school-62939
04/10/2026, 7:54 PMtall-airline-16756
04/10/2026, 7:54 PMtall-airline-16756
04/10/2026, 7:54 PMperform_rpc from your Python agent to Unity. I can help troubleshoot; a few likely causes and quick checks first:
• The Unity participant has not registered an RPC handler for the method name in unity_method_name. Confirm Unity calls room.registerRpcMethod(<that name>, handler).
• The Unity handler throws an exception or returns an invalid response. Check Unity logs for exceptions inside the handler and ensure it returns a proper RPC response or RpcError.
• Payload shape or types don't match what Unity expects (JSON structure, missing fields, or types). Verify payload_json matches the handler's expected schema.
• The handler takes longer than the response_timeout (8s) and times out, which can surface as an application error. Try increasing response_timeout to test.
• Identity mismatch: confirm target.identity is the Unity participant's current identity and that the participant is connected and reachable.
Please tell me:
1. Do you see any error or stack trace in the Unity logs when the RPC is invoked? If so, paste it.
2. How is the Unity handler registered (method name) and what does it expect as the payload? A short snippet helps.
3. Does the RPC ever succeed with a simpler payload or a no-op handler on Unity?
With those details I can suggest targeted fixes or specific code checks.
Sources: client-sdk-js | livekit/livekit_composite | DeepWiki | Build a healthcare intake assistant with an Anam avatar | LiveKit, with interactive elementsbig-school-62939
04/10/2026, 7:57 PMtall-airline-16756
04/10/2026, 7:58 PMperform_rpc call succeeds.
• Success response: return a serializable value (JSON string is recommended). The value should contain the result data your caller expects and be returned before the caller's response_timeout elapses.
• Error response: throw an RpcError (or the Unity SDK equivalent) with an integer error code and a descriptive message (optionally details). This sends structured error info back to the caller instead of a generic failure.
• Other requirements:
◦ Ensure the RPC method is registered with the exact method name used by the caller (room.RegisterRpcMethod(methodName, handler)).
◦ Catch internal exceptions in your handler and convert them to RpcError rather than letting unhandled exceptions propagate.
◦ Keep payload parsing/validation robust: validate the incoming JSON and return a clear RpcError for bad input.
If you’d like, paste your Unity handler code (or the method name and expected payload) and I’ll point out exactly what to change.
Sources: Forwarding to the frontend | LiveKit Documentation | Build a healthcare intake assistant with an Anam avatar | LiveKit | client-sdk-unity | livekit/livekit_composite | DeepWiki, with interactive elements