Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Flamesilver · Sep 12, 2013 at 11:55 PM · c#javascriptphysicsbox2d

Can I use Javascript (Unityscript) for Box2D for Unity or Farseer Physics?

I've spent a few months learning everything in Unity in Javascript and would prefer to stay in JS wherever possible. Due to the physics I want in my network multiplayer game project I would require some sort of 2D physics system so I can rewind and simulate properly, but I really don't want to learn C# if I can avoid it.

These are the implementations on the asset store I've been looking into:

Box2D for Unity Farseer for Unity

Would it be possible to use these script / functions in Javascript?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Benproductions1 · Sep 13, 2013 at 12:14 AM

Hello,

Because of the way Unity works (and frankly if it didn't work this way that would be very bad), all scripts compile down to the same thing. It doesn't matter if you write var integer:int; or public int integer;, after compiling it they are one and the same.
This allows for cross use of each language. You can always (except in very specific cases) call any function in C# as you can in UnityScript. Sometimes the documentation of packages are only in C# (and rightly so), but translating it is quite easy.
Most projects actually (when using packages) end up having quite a mix of javascript and C#

From a technical point of view, the only real difference between UnityScript and C# are syntax and defaults (as well as missing feature implementations in UnityScript)

Hope this helps,
Benproductions1

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Flamesilver · Sep 13, 2013 at 12:20 AM 0
Share

Thank you, this gives me great hope!

Although it would be beneficial to have C# for things such as callback functions (still haven't figured out function pointers other than anonymous functions), it's much more "comfortable" in Javascript for me.

Thanks again! You seem very active in these forums since you've given me great answers before.

avatar image Benproductions1 · Sep 14, 2013 at 01:22 AM 0
Share

Yea, UnityScript is missing a lot of the features of C#. I preffer the syntax in UnityScript too, but I need the more advanced C# features to work, so I use C#.

Glad I could help, I'm really not that active :)

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Simple car script not work on unity 5? 1 Answer

Need a simple car physics script working on unity 5? 1 Answer

Unity 3D - Rotating an object in relation to its velocity 0 Answers

How do I switch from Character player to Airship Vehicle using triggers? 0 Answers

Multiple Cars not working 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges