0

can i code in JS(JavaScript) and C# in unity together?

to make question more clear: E.g:

i want to use C# for scripting the animations, but use JS For Scripting Damage and Health.

can i do that?

note: sorry for the wrong spelling English is not my first language

3
  • 1
    Unity only supports C# Commented Apr 28, 2020 at 21:14
  • 1
    I think it should be possible, but it seems like a bad idea :) Just have whoever wants to do javascript spend a morning looking into C# syntax. Since the concepts are the same, it should be an easy transition. EDIT: Nevermind, javascript isn't supported anymore! Commented Apr 28, 2020 at 21:15
  • i looked into C#, i programmed in JS for 3 years, and i felt like its closer to Java than it is to JavaScript Commented Apr 30, 2020 at 0:50

1 Answer 1

1

Unity doesn't support Javascript since Unity 2017. If you are in an older version you can do it, however you must be sure that class containing the method to call is compiled before the one calling it. This is done by putting it first in the list.

Anyways, I don't recommend you to do so since it's against good practices to mix two languages in the same project.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks! turns out i was using unity since 2015 and ...... didn't update it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.