3
\$\begingroup\$

I'm new to Unity, but I'm more comfortable with Python.

Is there any way to use Python as scripting language in Unity 5?

I heard there is some language called Boo that has a syntax like Python but it seems Unity just supports C# and Javascript.

How can I add Boo or Python scripting to Unity 5?

\$\endgroup\$
5
  • \$\begingroup\$ Maybe they removed it because most people don't use it? I checked and I can't seem to find it either. \$\endgroup\$
    – BiiX
    Mar 24, 2016 at 9:02
  • 1
    \$\begingroup\$ @BiiX When they created Unity 5, they made a post on their forum about the current statistics of the engine, and they said, that around 3-5% of the people use Boo, so they dropped it to get more focus on C# and javascript (wich were almost equal) \$\endgroup\$
    – Bálint
    Mar 24, 2016 at 9:58
  • 7
    \$\begingroup\$ Don't fight it, go with the flow: learn c# and use it, You'll see it's great! \$\endgroup\$
    – Vaillancourt
    Mar 24, 2016 at 10:15
  • 1
    \$\begingroup\$ And TBH dynamically typed languages are mucky for large code bases, like a game. You wouldn't know whether the function returns a GameObject or a Transform till you ran the game. Same reason I cannot work with front end systems with JavaScript. Oh and Unity uses UnityScript, not JavaScript. UnityScript and JavaScript are waaay different, the most important difference being UnityScript uses static types unlike Java. \$\endgroup\$
    – EvilTak
    Mar 24, 2016 at 11:38
  • \$\begingroup\$ I know this is old, but Unity 2018 will drop support for JavaScript (Aka UnityScript) just learn C# because the new multi-threaded way of doing things C# Job Systems the new component system will require it. \$\endgroup\$ Apr 15, 2018 at 19:01

2 Answers 2

4
\$\begingroup\$

Unity's primary development language is C#. I am not aware of any way to add a new scripting language to Unity which works just like a native one.

But you can call Python from C# using IronPython. So you could implement a stub for each MonoBehaviour in C# which doesn't do more than call a Python script to implement the actual logic.

The end result might be that for many classes, the boilerplate C# code to call the Python implementation will be more code than the Python implementation itself. Also, there will be performance overhead for the switching between C# and Python, so your game won't be as fast as it would be when developed in pure C#.

Or you could just learn C#. The hardest part when learning a new programming language is usually to learn how to use all the libraries and APIs you need to do something productive with them. And you will have to learn the Unity scripting API anyway, no matter which programming language you use to call it.

\$\endgroup\$
0
\$\begingroup\$

Unity dropped the support for Boo, however Boo script can be use anyway. Check this post

\$\endgroup\$
2
  • 4
    \$\begingroup\$ This answer could be improved by explaining how a Boo script can be added even though the "Add new Boo script" context menu entry was removed. \$\endgroup\$
    – Philipp
    Mar 24, 2016 at 11:05
  • 1
    \$\begingroup\$ Infact, as it is, this only answers the actual question via a link. \$\endgroup\$
    – Gnemlock
    Jan 30, 2017 at 17:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .