Home > database >  How do to use a python script in Unity?
How do to use a python script in Unity?

Time:02-19

I'm trying to run a face detection model in Unity. It gets input from the webcam, then spits out a face. But trying to make this work with C# has been an absolute nightmare. And despite all my suffering, I still haven't been able to make it work!

If I could use python, I'd be able to get it done easily. So, obviously, I want to find a way to get a python script working in Unity. But IronPython is the only thing I've been able to find, and it's outdated.

I need either knowledge of how to make IronPython work in spite of being outdated, or some other method. Please.

CodePudding user response:

Unfortunately, Unity at this time does not support Python. Although, there is an asset that you can use a bit of Python with. I am not sure what you can do with this asset but I know it could help a minimal amount:https://assetstore.unity.com/packages/tools/integration/python-interpreter-645

Quick Note: Most programming languages work about the same way. If you figure out the documentation and grammar/punctuation for C#/UnityC#, you should be off just fine.

CodePudding user response:

You can just run your python script on playtime and let it create some data in files. Then read the files using C# and display data in Unity.

  • Related