- Home /
iOS: Missing CapsuleCollider when creating PrimitiveType.Cylinder
Unity version: 3.5.6f4 Platform: iOS (iPad) Architecture: Armv7
When I run my application I am not able to create a GameObject through the following code:
GameObject.CreatePrimitive( PrimitiveType.Cylinder );
The application crashes directly and I get the following output in xCode:
Can't add component because class 'CapsuleCollider' doesn't exist!
Keeps happening in my project even if I create a new scene and only assign a script with the previous code in the Awake function. Issue keeps recurring also when completely removing and rebuilding the xcode project.
When I create an empty gameobject and add the following code in my Awake function it also crashes:
gameObject.AddComponent( "CapsuleCollider" );
When I look in the RegisterMonoModules.cpp file I notice that all my default components are available (BoxCollider, MeshCollider etc) but I am missing a reference to CapsuleCollider!
The only work around for me now is to add a CapsuleCollider component (through AddComponent()
or by drag and drop) and disable or destroy it. This will create the direct reference...but...shouldn't (and isn't ) this component always be available???
And it looks like Unity is creating the CapsuleCollider in GameObject.CreatePrimitive()
by using AddComponent( string )
instead of AddComponent()
...why, wouldn't the second option be better???
If I create a complete new project everything works fine.
I have no clue why CapsuleCollider isn't registered in RegisterMonoModules.cpp in my current project... anyone have an idea..it's driving me nuts...
I'm having this exact same problem on iOS - what exactly did you do to get around it?
We just added a capsule collider to a gameobject and deleted it through a script at startup in a Awake function...it;s a very nasty hack, but it worked :)
Hopes it helps you!
Answer by daveratters · May 22, 2013 at 01:42 PM
I just fixed it here too - in our case I just added a CapsuleCollider as a component where the script lived in the editor. Before I added the component it worked fine on everything - Windows + Mac in editor, as a player etc. but not on iOS on our iPad. Annoying...
Answer by iloveimy · Jun 23, 2017 at 06:44 AM
I have the same program. Cancel "Strip Engine Code" will find. it work to me.
Your answer
Follow this Question
Related Questions
Missing files in Xcode 0 Answers
Missing Enable Modules in Xcode 1 Answer
iAd Interstitial Will Not Display 0 Answers
Admob iOS integration with Xcode Version 6.3 1 Answer
"Culture name neutral is not supported" when using Parse.Unity.dll 2 Answers