1. Forums
  2. Discord
  3. About Mapcore
  4. Patreon Supporters
  • Login
  • Register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • More Options
  1. Mapcore
  2. Discussions
  3. Off-Topic

Leap Motion with Unity 5

  • laminutederire
  • January 27, 2016 at 9:32 AM
  • laminutederire
    • January 27, 2016 at 9:32 AM
    • #1

    I'm a newbie, so I figured I might ask

    Has anyone ever used a leap motion sensor (link) with Unity?

    If so, the modules for that hardware for Unity are written in C#, but with my group we wanted to code in Javascript. I haven't found infos about how to use different languages in the same game, is that possible and if so is it hard?

    I know games are usually designed like that with different languages for optimization purposes, but is it possible with Unity?

    Thanks in advance for your expertise!

  • clankill3r
    • January 27, 2016 at 8:20 PM
    • #2

    I think you have better luck asking on either the leap or unity forum.
    I guess it is possible.

  • laminutederire
    • January 27, 2016 at 8:29 PM
    • #3
    Quote from clankill3r

    I think you have better luck asking on either the leap or unity forum.
    I guess it is possible.

    I do that too but I figured having experience from people here might help :)

  • clankill3r
    • January 27, 2016 at 9:34 PM
    • #4

    I have a bit experience with leap and a bit with Unity but not the combination.
    How do you normally load the library when you use leap with javascript?

  • laminutederire
    • January 27, 2016 at 9:50 PM
    • #5

    @clankill3r

    The library for Unity is in C#, a language I don't know, I don't know Javascript either, so I'll have to learn either one of them.

    (I basically only know well Python)

    And I heard JS is easier than C# but doing the game with the leap in JS would mean either doing it without Unity, and end up with something really simplified ( got only 3 months to do the project after study hours ), or trying to do it in Unity, mixing scripts in C# (leap motion scripts ) and JS (my scripts), or doing it all in C# in Unity.

    I'm just afraid not to have enough time to learn C# because it looks frightening, what would you recommend?

  • Corwin
    • January 27, 2016 at 10:36 PM
    • #6

    About mixing JS and C#, my understanding is that it is possible but a bit messy because you have to understand script compilation order

    Quote

    All scripts that are compiled in this step have access to all scripts in the first group ("Standard Assets", "Pro Standard Assets" or "Plugins"). This allows you to let different scripting languages interoperate. For example, if you want to create a Javascript that uses a C# script: place the C# script in the "Standard Assets" folder and the Javascript outside of the "Standard Assets" folder. The Javascript can now reference the C# script directly.

    See here: http://docs.unity3d.com/412/Documentat…Advanced29.html


    EDIT: Maybe this one is clearer:

    Quote

    Accessing a variable defined in C# from JavascriptTo access variables defined in C# scripts the compiled Assembly containing the C# code must exist when the Javascript code is compiled. Unity performs the compilation in different stages as described in the Script Compilation section in the Scripting Reference. If you want to create a Javascript that uses classes or variables from a C# script just place the C# script in the "Standard Assets", "Pro Standard Assets" or "Plugins" folder and the Javascript outside of these folders. The code inside the "Standard Assets", "Pro Standard Assets" or "Plugins" is compiled first and the code outside is compiled in a later step making the Types defined in the compilation step (your C# script) available to later compilation steps (your Javascript script).

    In general the code inside the "Standard Assets", "Pro Standard Assets" or "Plugins" folders, regardless of the language (C#, Javascript or Boo), will be compiled first and available to scripts in subsequent compilation steps.

    http://docs.unity3d.com/412/Documentat…/Scripting.html

    Good luck, unity is nice but can be a bit weird sometimes to get to think within its boundaries and work around its limitations

  • laminutederire
    • January 28, 2016 at 6:41 AM
    • #7
    Quote from Corwin

    About mixing JS and C#, my understanding is that it is possible but a bit messy because you have to understand script compilation order

    See here: http://docs.unity3d.com/412/Documentat…Advanced29.html


    EDIT: Maybe this one is clearer:

    http://docs.unity3d.com/412/Documentat…/Scripting.html

    Good luck, unity is nice but can be a bit weird sometimes to get to think within its boundaries and work around its limitations

    Display More

    merci beaucoup

    i wasn't sure I understood it right :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself Login
Discord

The Mapcore Discord is our lively IRC channel of the 2000s reborn. Chat about level design, gaming, and more.

Latest Posts

  1. Tangerine

    Harry Poster
    July 18, 2026 at 11:10 AM
  2. Any of the old guard still around? D:

    Warby
    July 12, 2026 at 8:23 PM
  3. About our archived forums

    Thrik
    June 30, 2026 at 2:12 PM
  4. Mapcore Discord

    mason_fan123
    June 24, 2026 at 8:52 PM
  5. [CS2] Valley

    Serialmapper
    June 22, 2026 at 11:56 AM
  6. Free Music / SFX Resource - Over 2500 Tracks

    Eric Matyas
    June 18, 2026 at 12:32 PM
  7. Pango [WIP]

    Elowen
    June 11, 2026 at 10:13 AM
  8. [CS2] Dvina

    Jeremy Rivera
    June 11, 2026 at 10:03 AM
  9. Bridges 2.0 by NEXSIDE, MAP SHOWCASE. ( Steam Workshop )

    MrTrane18
    June 1, 2026 at 7:46 PM
  10. Classic Maps Reborn For CS2

    SillySpaceCat
    May 31, 2026 at 10:33 PM
  1. Privacy Policy
  2. Contact
Powered by WoltLab Suite™