Search Feedback


F# support




F# is rapidly gaining popularity in the .NET community. There are several game developers who are using it outside Unity, and even Xamarin products now support it.

It would be nice to be able to use F# for scripting in Unity.

Comments (25)

  1. F59b4b8fb96df7f5f721e715d43175da?d=mm


    Dec 10, 2014 17:07

    I'm also curious what IL2CPP will do to third party language support like F#.

  2. F59b4b8fb96df7f5f721e715d43175da?d=mm


    Dec 10, 2014 16:56

    It would be nice to see support for any .net language without having to import a dll. Maybe with some sort of editor plugin. Personally I'd like to see some sort of partnership with RemObjects to bring Silver (Apple Swift for .net) as a native supported language. Since I use Swift for my day job, it would be nice to also use it for Unity. There are a lot of Unity developers coming from the Mac platform. I think it would be cool to see both C# and Silver as primary languages. F# would be cool as an official language too. Functional languages are well suited for game design.

  3. A266827481c20c039c073fb93cea715e?d=mm


    Aug 27, 2014 05:46

    I wish I could vote down on this one. We already have 3 languages, all of which need work in terms of how well they play together, and how well mono deals with them. Once they are all 100% cross functional and bug free then yeah...

  4. 7e2b8bf3ae78a88c2ccd49805df19ac4?d=mm


    Jun 03, 2014 23:42

    F# works, though not perfectly; for example, I built a project using F# in which Seq.sort ran fine on Android, but it crashed under iOS. Wound up having to code a work-around in C# for iOS devices.

    Also, it would be great to have debugging capability for F# code. Building a DLL works fine, but you can't pause execution in code, that way.

    F# is the future, as far as I'm concerned. If you look at Swift (Apple's new programming language, meant as the successor to Objective-C), it looks and functions a lot like F#, even more than it does C#. Critical mass toward F# is building up and up; it's a very efficient, powerful, clean, and FUN way to code, and as good as C# is (great language), once you try F# for a short while, you can't go back.

    Here's hoping for full support for F# in Unity!

  5. 3d0362d4928b71afaf8d34fb82503eaa?d=mm


    Oct 17, 2013 13:48

    You should already be able to.

    Just write your scripts in F# (in any text/code editor), and compile them to a dll (with any F# compiler, making sure to include "[Where you installed Unity]/Editor/Data/Managed/UnityEngine.dll" as a dependency). Then add the dll to your project's Assets directory.

    After doing that, your dll will show up inside the Unity editor with a little "expand" arrow next to it, clicking it will show all the scripts inside it (ie classes inherited from MonoBehavior) and you can attach them to game objects just like you would a C#/Boo/JS script.

    I've already tried this using the Nemerle language and it works fine. It should work fine with any CLI/.NET/Mono-based language.

    If you're using the command-line F# compiler and you need a better idea of what commandline arguments to pass, you can check what Unity does by opening an existing C#/Boo/JS Unity script in MonoDevelop, build the project ("Build" -> "Build All"), and then click on the bottom status bar where it says "Build successful" or "Build: # error, # warning" to bring up the error panel. On that error panel, click the "Build Output" button to see all the commands that were used to build. Adapt those to your project and whatever compiler you're using.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea








AI & Navigation






Asset Store






Cloud Build




Docs & Tutorials






Game Performance Reporting


















Profiling & Optimization