x


Using F# with Unity

I am trying to use F# with Unity.

But when I compile an F# program to a DLL and import the DLL in my assets folder in Unity, Unity gives me the following error:

"GLib: Cannot convert message: Conversion from character set 'UTF-8' to 'CP1252' is not supported"

What can I do to use F# DLL's in Unity?

more ▼

asked Mar 15 '10 at 10:05 PM

Nis 1 gravatar image

Nis 1
81 2 4 5

Can you give any more details about what the F# code is doing and what libraries it uses? There are some things that are available to general .NET code that are not supported by Unity.

Mar 24 '10 at 04:15 PM andeeee ♦
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I was able to get an F# dll to work without much additional configuration. -Make sure you also drag in FSharp.Core.dll in the asset folder. -Make sure your F# dll is compile to target .NET 2.0 and not 4.0 since Mono does not support the latter yet.

more ▼

answered Jan 04 '11 at 08:13 PM

Johan 2 gravatar image

Johan 2
128 4 4 10

In addition, when using types inheriting MonoBehaviour you must use a Namespace instead of an F# Module. Otherwise Unity3d will complain that your class name does not match your filename when you try to attach the MonoBehaviour to a GameObject

May 10 '12 at 12:02 AM cessationoftime
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

asked: Mar 15 '10 at 10:05 PM

Seen: 2669 times

Last Updated: Jan 07 at 02:28 AM