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 Earth-O-Matic · Apr 16, 2011 at 04:17 AM · erroriosbuildmacpc

Game not building on Mac iOS but works fine on PC

So I built my game on my PC and I'm ready to start testing it on my ipod touch. So I installed unity iOS on my mac laptop and copied my project folder over. When I try to build for iOS I get errors on things that seem like they should really work just fine like:

'enabled' is not a member of 'UnityEngine.Component'

or

'isKinematic' is not a member of 'UnityEngine.Component'

any one have any idea what could be happening? Thank you!

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

3 Replies

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

Answer by Eric5h5 · Apr 16, 2011 at 07:21 AM

There's no dynamic typing on iOS. Put "#pragma strict" in all your scripts. There are already many many answers for the question of how to deal with no dynamic typing with GetComponent etc.; should be easy to find with a search.

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 Earth-O-Matic · Apr 16, 2011 at 08:03 PM 0
Share

pragrma strict pointed out about 25 errors and I've been slowly going through them and fixing them. I'm new to progra$$anonymous$$g... very much so so its challenging to figure out how to do this stuff without dynamic typing since this is the first I've heard of it.

I only have 2 issues left though and I'll be back on track. So for anyone out there wanting to build for iOS just throw "#pragma strict" at the start of all your scripts as Eric5h5 suggests. It will be a head ache to basically re-$$anonymous$$ch yourself but its worth it. Thanks Eric5h5, will be more posts from me to help figure out my 2 issues left

avatar image Eric5h5 · Apr 16, 2011 at 11:32 PM 0
Share

Back when Unity iOS was a separate app, it automatically assumed "#pragma strict" for all JS scripts regardless of whether you put it there or not. It would be nice if Unity still did that, though probably the merging of Unity with Unity iOS complicates things.

avatar image
0

Answer by Ashkan_gc · Apr 16, 2011 at 04:49 AM

sometimes some of the normal codes don't work on unity iphone. i saw this back in 1.7 when i was working in an IOS development project. you can adjust the .net support level in player settings. set it to the full support (not subset) and it should works fine.

check the code lines that they have errors and see if casting is done correctly or not. i don't remember weather javascript's casting works on ios or not.

posting some pieces of the code that get error could be helpful to get better answers too.

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 Earth-O-Matic · Apr 16, 2011 at 05:20 AM 0
Share

Here is a snip of code form one of the problem scripts that have the enabled not in unityengine.component

if (GUI.Button (position5, plankPhy, style5)) if (Physics.Raycast (ray, hit, 300)) { Instantiate(PhyPlank, hit.point, Quaternion.identity); GetComponent(ClickSpawn).enabled = false; Time.timeScale = .0000001; }

where GetComponent(ClickSpawn).enabled = false; is the problem line this is deactivating a code that allows spawning an object when the mouse clicks

avatar image Earth-O-Matic · Apr 16, 2011 at 05:20 AM 0
Share

aaaah that look sterrible I'll post as an answer

avatar image
0

Answer by Earth-O-Matic · Apr 16, 2011 at 05:22 AM

Here is a snip of code form one of the problem scripts that have the enabled not in unityengine.component

   if (GUI.Button (position5, plankPhy, style5)) 
            if (Physics.Raycast (ray, hit, 300)) { 
                  Instantiate(PhyPlank, hit.point, Quaternion.identity) 
                  GetComponent(ClickSpawn).enabled = false; 
                  Time.timeScale = .0000001; 
} 

where GetComponent(ClickSpawn).enabled = false; is the problem line this is deactivating a code that allows spawning an object when the mouse clicks

Comment
Add comment · Show 1 · 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 Earth-O-Matic · Apr 16, 2011 at 05:22 AM 0
Share

Also this is in JS

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

1 Person is following this question.

avatar image

Related Questions

Build Error on PC!! HELP!!!! 1 Answer

My Mac Build doesn't Work 1 Answer

Distribute terrain in zones 3 Answers

Unity crash on build to iOS 2 Answers

"EntityComponentSystemSamples" Building on iOS causes an error 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