Communication from React --> Unity Not Firing #390
-
Hello! I'm so sorry to bother you, but I was wondering if I could get your help figuring out why my messages from React aren't reaching Unity? In my React page, I try sending two messages to Unity in a React useEffect hook. The first one is the one I actually want (sending a string to my public Game Manager) and the other is a test, similar to the example implementation (with Spawn Enemies). Unfortunately, it never seems to fire/register in my Unity Debug Logs. I ended up testing it as the example implementation, and it worked when firing from a button onClick, so I think it's due to the fact that my Unity scene has loaded / is on the first frame by the time I'm clicking the button. Is there a listener for when the Unity build's awake function or is the best solution? The Unity environment is 2020.3.30f1 and here is my package.json with all my modules; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry I ended up figuring a workaround! Ended up setting a message from Unity to React when the start function fired and then fired the message from React to Unity |
Beta Was this translation helpful? Give feedback.
Sorry I ended up figuring a workaround! Ended up setting a message from Unity to React when the start function fired and then fired the message from React to Unity