Closed AlePe93 closed 4 years ago
If I understand correctly, you do not have an agent in your scene. Is that correct?
Side channel messages are buffered and only sent when an agent step is triggered, in which case it will send any buffered messages. It is not intended for general RPC with Python and does not run in heuristic or model-based modes, only in training -- though a feature request can be made to expand the scope of the API if that's what you're after.
If I understand correctly, you do not have an agent in your scene. Is that correct?
Side channel messages are buffered and only sent when an agent step is triggered, in which case it will send any buffered messages. It is not intended for general RPC with Python and does not run in heuristic or model-based modes, only in training -- though a feature request can be made to expand the scope of the API if that's what you're after.
Hi, thanks for the reply! I appreciate it. Yes i do not have an agent in my project because what i'm trying to do is just connect the two environments: Python and Unity. First i'd like to ask you this: since my goal is to do some basic "if result = a" (in python) then "something happens" (in Unity) could you suggest me what could be a possibile solution?
Second if there's no answer to my first question, i'm gonna make a feature request in order to achieve my goal!
Thanks in advance for feature help.
If your goal is simple RPC with a Python component it would probably be best to implement your own socket server and channel. If your objective is just to write logic in Python within your Unity project you might want to follow this project: https://docs.unity3d.com/Packages/com.unity.scripting.python@2.0/manual/index.html
Thank you for the reply. I tried the second example you suggested me but sadly i'm working in python which has some libraries that require version at least 3.6, what you linked works only with python 2. I appreciate anyway the help.
Have a good day!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi, first of all i want to explain my goal: what i'm trying to do is making an example that can establish a connection between unity and python in order to exchange messages. Because after that i'd like to make a program in python that, according to the result of the python program something happens in unity ( for instance: if python prompt "a", in unity will appear a red sphere. if python prompt "b" it will appear in unity a blue cube and so on.) First question is: am i following the right path in order to achieve my objective by reading this guide https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Custom-SideChannels.md ?
If yes then i'll explain what i did and what error i got.
Steps i did in Unity:
Steps i did in python:
Then, i runned first the python program and then pressed play in Unity and got the error in the python console reported below. I also switched the running order: i first pressed play in Unity then runned the python program.
Thanks in advance for the help
The error i get is this one: