0

I have a small problem here.

I run a batch and a python script in my software in Unity. Under unity everything works fine, but when i build, it seems like my .bat and .py are left behind, it's not working anymore when i launched my .exe

I call my .py and .bat with this :

Application.dataPath + "/Folder/pythonscript.py"

Thank you in advance for your help.

foufrix
  • 1,324
  • 4
  • 21
  • 45
  • Do you have any error logs from the exe? And how are you including a python interpreter in the project? – bob0the0mighty Jul 13 '16 at 12:45
  • I use a Blender command. I set the blender path in my Batch. In unity i call my batch which call my python and set all the path to make things works. – foufrix Jul 13 '16 at 13:02
  • I can only offer a guess, but are you sure your exe has rights to access blender? This assumes that the python script and batch file are being included in the final exe. Apart from that, why are you using an external tool to run a python script from Unity? – bob0the0mighty Jul 13 '16 at 13:15
  • yes it launches blender with no error, lucky for me. I found a way, after building your .exe in unity, just put your script in the folder MyProject_Data, it's a folder created in the same folder of the .exe Sorry i did not understand your last question, you mean use a batch ? I'm new in coding, so i use it like this. You think it's better to directly call in C# ? – foufrix Jul 13 '16 at 13:50
  • Bjour Raphael, answer is simple, in Unity you can ONLY use Application.persistentDataPath - it's just one of those weird things about Unity. It is pointless they even mention the others as they don't work. http://stackoverflow.com/a/35941579/294884 – Fattie Jul 13 '16 at 14:52
  • Ok ! I'm taking a look and will update as soon as i get it working ! Thank you for your answer, and yea very weird ! – foufrix Jul 18 '16 at 13:31

0 Answers0