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 shortyzsly · Feb 14, 2015 at 11:03 PM · androidjavascriptscripting problemcompiler errordynamic typing

Building on android.

Hi I'm an avid unity developer its been a love of mine for quite a while (going on 3 years) and i've had several mess about practice projects in that time frame but i'm working on a serious game at the moment and have fairly big plans for it as so far i've put alot of work into it.

A small few details to help you understand my issue. It's a first person horror genre game. horror survival if you will, in which you play as a policeman (detective) who gets caught up to answer a late night distress call about a disturbance among some of the patients. Only to find the staff and patients missing...... but your certainly not alone.....

Now...to the point... I have been using mainly unityscript and little bits of c# lately alot of the time depending on if i cannot brew up a script to achieve my needs at the time.

I switched platform recently, to android.... in which to achieve an easier method of distribution. Via APK file being shared amongst friends/testers twitter followers etc with android supported handsets. However after determining which assets need to be reimported into my project for that plaform and the actually manage to finish importing them (My project is quite large so far).... My console log is rampant with compiler errors now after the import finishes.

I have searched high and low for a solution and the only one i can come across is talking about my variable types not being specific for android to understand. in other words.. something about... is it... "dynamic typing"

Any light shed on this topic would be greatly appreciated.

Thanks in advance folks.

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 pako · Feb 15, 2015 at 10:31 AM

From the manual: "For performance reasons, dynamic typing in JavaScript is always turned off in Unity Android, as if #pragma strict were applied automatically to all scripts". See "How Unity Android Differs from Desktop Unity" in:

http://docs.unity3d.com/Manual/android-GettingStarted.html

So, make sure all your variables are explicitly typed.

Comment
Add comment · Show 6 · 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 shortyzsly · Feb 15, 2015 at 08:52 PM 0
Share

So var musicObject : GameObject - becomes public/private var musicObject : GameObject

Is this correct?

avatar image pako · Feb 15, 2015 at 09:41 PM 1
Share

No, the public/private is the accessor, not the object type. Explicit typing is when you use the ": GameObject" after the variable name (or any other type ins$$anonymous$$d of GameObject).

Just make sure that all your variables declare a type by using

": TYPE" after the variable name.

See also this:

http://answers.unity3d.com/questions/206424/pragma-strict.html

avatar image pako · Feb 16, 2015 at 08:57 AM 0
Share

So, is it working now?

avatar image shortyzsly · Mar 21, 2015 at 10:56 PM 0
Share

I got this problem sorted. $$anonymous$$uch appreciated. Now stuck with many draw calls and the draw call package from asset store gives errors lol

avatar image pako · Mar 22, 2015 at 12:11 AM 1
Share

Please note that it's considered good practice in this forum to accept an answer that has helped you (click the check-mark icon below the down-vote icon). It's also good practice to up-vote the answers and comments that you have found are especially useful.

Your draw calls issue seems to be the subject for a new question, as this one has been answered.

Show more comments

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

'GetComponent' is not a member of 'Object'. 2 Answers

How do i need to change this script for mobile? 1 Answer

game won't work in build 0 Answers

[JS] Match 3 game - How to compare certain values stocked in a multi-dimensional Array 1 Answer

how to make it that longer the key is pressed the faster the object rotates? 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