bengreenier / bengreenier/webrtc-unity-plugin
Create answer problem.
- Dominant language
- C#
- Stars
- 117
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Hi, great work with this plugin.
I'm facing into answer generation problem
...
PeerEventsInstance.SetRemoteDescription("offer", sdp);
PeerEventsInstance.CreateAnswer();
...
After CreateAnswer is called, unity shows me this error
```
PeerConnection cannot create an answer in a state other than have-remote-offer or have-local-pranswer.
UnityEngine.Debug:LogError(Object)
UnityWebrtc.WebrtcPeerEvents:OnFailure_Listener(String) (at Assets/UnityWebrtc/WebrtcPeerEvents.cs:189)
UnityEngine.Events.UnityEvent`1:Invoke(String)
UnityWebrtc.<>c__DisplayClass20_0:b__0() (at Assets/UnityWebrtc/WebrtcPeerEvents.cs:233)
UnityWebrtc.WebrtcPeerEvents:Update() (at Assets/UnityWebrtc/WebrtcPeerEvents.cs:155)
```
Surfing on web i found that a solution can be call CreateAnswer after SetRemoteDescritpion has finished completly ( setRemoteDescription.then(...) ), so i tried to call CreateAsnwer after some seconds without success.
Any idea?
Thanks
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the SetRemoteDescription and CreateAnswer calls in the issue, then inspect Assets/UnityWebrtc/WebrtcPeerEvents.cs around lines 155, 189, and 233. Reproduce the Unity error and trace the peer connection state before CreateAnswer; done means the reported answer-generation sequence no longer logs the invalid-state failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- audio-video-rtc, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100