Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 castor · Jul 16, 2015 at 02:47 AM · c#behaviourstate machine

Unity 5 - new Animator State machine behaviour: ca we use UnityScript?

Is that possible? Are you forced to only use C#?

Even if I end up learning C#, the whole project is written in Javascript and I have the Script Execution order set to compile C# first so I wouldn't be able to access any of my scripts, right?

UPDATE: I just realized how unclear I was, I'm referring to Unity 5 new Animator feature: https://unity3d.com/learn/tutorials/modules/beginner/5-pre-order-beta/state-machine-behaviours

Comment
Add comment · Show 3
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 Ibzy · Jul 16, 2015 at 11:54 AM 0
Share

http://answers.unity3d.com/questions/201907/easiest-way-to-implement-finite-state-machine-in-j.html

This guy asked a similar question and appears to have found an answer.

avatar image AlwaysSunny · Jul 16, 2015 at 03:44 PM 0
Share

http://docs.unity3d.com/$$anonymous$$anual/ScriptCompileOrderFolders.html

This document addresses your secondary question about compilation order. Note that C# is empirically superior to unityscript, and is strongly preferred by the overwhel$$anonymous$$g majority of unity veterans. Definitely worth making the switch for your next project.

avatar image castor · Jul 16, 2015 at 04:25 PM 0
Share

I should have been more clear in my question, I'm asking about a specific Unity 5 Animator feature that apparently is C# only: https://unity3d.com/learn/tutorials/modules/beginner/5-pre-order-beta/state-machine-behaviours

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by AlwaysSunny · Jul 16, 2015 at 04:49 PM

95% sure you can't use .js for this. You may still be able to achieve what you want without converting your whole project to C#, (refer to the document I linked in my comment if you're having trouble) but these StateMachineBehaviour things need to be written in C#.

Not as intimidating as it sounds. There's a lot of overlap between the two languages, many differences are minor, and you won't need to learn all the major differences immediately.

Comment
Add comment · Show 4 · 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 castor · Jul 16, 2015 at 05:06 PM 0
Share

Why do they need to be written in c#? Also, even if I become proficient in C#, I've already established the script execution order due to other limitations with plugins and c# scripts are being loaded AFTER Javascript, so I wouldn't be able to communicate with the core game scripts. Is this going to be supported in the future? Why a decision like this?

avatar image AlwaysSunny · Jul 16, 2015 at 05:21 PM 1
Share

Can't speak authoritatively about specifics like this, but I don't think there are plans to change this. It's always been this way.

It has something to do with how scripts compile and subsequently identify one another; cross-language support is limited. I don't think this is a "decision" but rather a "limitation".

It's highly preferable to use a single language in a project for these reasons, and C# is highly preferable for numerous reasons. Evidently C#'s polymorphism and/or other exclusive features are key aspects of these State$$anonymous$$achineBehaviour things. I'm of the opinion that Unity should drop unityscript (and boo). $$anonymous$$ost of the time people have problems with them, the answer can be found in C#.

Basically:
.js is simple
C# is powerful

avatar image castor · Jul 16, 2015 at 05:35 PM 0
Share

Sorry for sounding frustrated (and thanks for the replies so far) but I already know this. I've been working on this project for 3 years and changing everything to c# is NOT an option. I've learned the disavantages of javascript and will change languages on my next game. $$anonymous$$y question though, is about being able to use this new Unity feature with Unityscript, a STILL supported language in Unity, which I chose because I wasn't aware they were going to start doing language unique features as core as this one...

avatar image AlwaysSunny · Jul 16, 2015 at 06:03 PM 1
Share

Depending on your specific situation, there may be some way to work around whatever trouble you're having with writing these in C#. I assume it's something about referencing .js scripts from within these State$$anonymous$$achineBehaviours?

I'm sure you're not the first person to want to do more than seems superficially possible with unity's compilation order shenanigans. I'd look into more generic questions on that issue. It's possible someone has devised a clever workaround for just such an occasion.

Again, I wish Unity would talk more about this kind of shortco$$anonymous$$g upfront, especially somewhere new developers would see it. So many newcomers gravitate towards .js for its apparent simplicity, but so often I see them struggle with issues which wouldn't arise in C#, or graduate to C# later saying "I wish I'd never bothered with unityscript".

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

23 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Alternative to Update 1 Answer

Script on two objects only runs as a single instance? 2 Answers

Incremental Move and stop 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