Collision is not detected on device? Wtf?

Title says it all. Made a simple onTrigger script, did everything right, like I have done it a thousand times before…

The collision worked fine on the game view in unity, so I uploaded it to my android, but it does not work on android? What is this? The collision is detected fine on my pc but not on my android? Why is this!? It is driving me nuts!

1 Like

Is this a box collider trigger?

Ok, maybe I should explain the whole thing better, so you can better understand what I’m trying to do here.

I want to create a door, and when you look at the door, a button appears and if you tap it it takes you “outside” or to the next scene. I have a long, thin, trigger capsule collider that points wherever the player looks (it’s attached to the main camera) . This is called the player manager. It has a rigidbody attached for onTrigger events. I use it to pick up objects, open doors, activate things the player is looking at, etc.

Now I have a door. Its just a cube with a door texture I found on google images lol. It also has an onTrigger collider, but no rigidbody. I have a simple one line script on my door (its literally just a single public variable). The script basically says what scene the door goes to.

So, I made a script for the player manager. It basically says that onTriggerEnter, if other tag == door than a button appears. When you click the button it takes you to the new scene. The script is very simple, and works ABSOLUTELY FINE in the editor. I press play, and look at the door, and the button appears, I click it, and boom, next scene.

But for some reason unbeknownst to me the script does not work on my actual android. Its like the collision isnt detected on my device or something. It is very bizarre, and I have tried almost everything, and cannot figure out why it isn’t working. These forums are my last resort lol

P.S. just for a test, I scratched the whole button thing, and made it so that the scene automatically changes when the collision is detected. Once again, worked fine in editor, but not on my android. So my android is deffinately not even detecting the collision.

1 Like

What would happen if you were to replace the capsule collider trigger with a box trigger of similar dimensions?

Makes no difference, its the same exact thing with a different shape, isn’t it? I tried every type of collider…

Well anyways it didnt work :confused:

My biggest issue is understanding what could possibly cause something to not work on my android that works fine in the editor.

It’s possible that the Android implementation of either PhysX or the Unity Physics wrapper has a bug.

Does everything work on an actual PC build? Or with WebPlayer or WebGL?

Well, i click play in the editor, and everything works fine. but on android it does not.

oh, btw, I just got unity 5, is this a unity 5 bug? because this never happened on unity 4

Could I possibly fix this issue by reinstalling Unity 5? This wouldnt mess up my save files would it?

cl.9 was suggesting doing a pc build to test (not run in editor).

re-installing unity is unlikely to solve the problem.

I have the same problems on iOS devices. But the bad thing is it is happening occasionally.
So basically, on average, If I run the game 3 times on an iPhone, 1 out of the 3s : none of the colliders are working, no trigger entered, no colliding (raycast is still fine).

And I always get these WARNING in XCode :

Multiple managers are loaded of type: PlayerSettings
(Filename: Line: 276)
Multiple managers are loaded of type: TagManager
(Filename: Line: 276)
Multiple managers are loaded of type: PhysicsManager
(Filename: Line: 276)
Multiple managers are loaded of type: QualitySettings
(Filename: Line: 276)
Multiple managers are loaded of type: Physics2DSettings

Did anyone come up with a solution ? Is it a bug or a setting issue ? It seems to be a very serious issue.

1 Like

Yes.

Also, I’ve messaged @MortenSkaaning regarding problems with triggers and colliders not working properly on iOS and Android.

Hi,

Can I get you to submit a bug report with a repro case for this? Then it’s easier to test across multiple devices.

Thanks

Hi Morten,

I assume you are asking both me and sam. My scene is quite big but I’ll try to simplify it and will submit a bug report.

At the moment, It looks like I run into another issue which I can’t reproduce the problem because the XCode keep crashing on me on the error Could not produce class with ID 159 (Screenshot). I’ve done nothing different from the last message that could cause this except deleting some objects from the scene and straight to build to XCode. Looks like Unity 5 is a very random guy :slight_smile:

2100766--137557--XCodeCrash.png

We’d love to get a bug report on the “Could not produce class with ID 159” problem as well.

Actually, I found the issue is caused by this plugin : https://www.assetstore.unity3d.com/en/#!/content/26181
It created an invisible game object (somehow it’s so invisible that I don’t know how to make it visible) that refer to EditorSettings.

I’m also receiving the “Multiple managers are loaded of type: PlayerSettings” error from when I installed that plugin.
I’ll try to dig more on this, and I’ll point the developer to this task.

Well, seeing as this seems to be more of a bug then human error (which is what I was hoping for) and it is currently somewhat unfixable, is there any way to detect objects without onTrigger collisions?

p.s. I am also getting lots of weird, random error messages in the editor that I have never seen before, but they are very random when they appear, so I can’t really recreate the error. I will copy/paste it here when I see them again though.

Ok, here is the error I get like every 30 minutes when the editor is open.

<RI.Hid> Failed to create device file:
2 The system cannot find the file specified.

Does this mean anything? I have never seen it before until recently, same time onTrigger collisions stopped working.

Hi, I’m the author of Inspector Navigator, and I wanted to say I’m working on fixing some of these problems (there’s a lot of weird stuff mentioned on this thread, and I’m sure that not everything is related to Inspector Navigator :wink:

However it seems that the object I create to keep the inspector breadcrumbs can point to many objects like the project settings stuff, and this can cause problems in some builds.

Because of that, I hope to release in a couple of days a new update to address the source of these issues:

  • Using Unity5’s HideFlags.DontSaveInBuild the breadcrumbs will no longer be included on builds
  • For Unity4.x I’m adding an option to remove all the breadcrumbs from all project scenes, so it can be used before a build.
  • ProjectSettings objects (those mentioned in the 'Multiple managers are loaded’ errors) will now be filtered (not included in the inspector breadcrumbs) - I don’t know why these problems show now, why this objects are not singletons (preventing multiple instances), or why a reference to the object is causing unity to instance more copies of them, but hey! :-/
  • And many other small fixes that will hopefully help getting rid of these issues.

Anyone experiencing problems with Inspector Navigator, please email contact@wasabimole.com

Thank you!

3 Likes