r/UnityHelp • • May 16 '23

Android Build Physics isn't working as intended, any ideas?

I'm pretty new to Unity and made this little game using the Unity Remote app (whoops), however, when I built the game on my phone, the collision physics fell apart.

The intended interaction is for the hat to pop onto the head when the head catches up to it, which is working fine on my PC, but on mobile, it's like the 2 rigid bodies don't react at all.

I can get whatever further info you might need, but for now, I've dropped a clip of the interaction working properly on PC, and improperly on mobile, along with screencaps of the 2 RBs. I am at a loss.

I've tried messing with the fixed update method and various collision detection options but to no avail...

Any advice would be appreciated, thanks!

2 Upvotes

3 comments sorted by

1

u/NinjaLancer May 16 '23

Weird behavior..

Is there code in the Update method anywhere that is related to this functionality? It could be a frame rate dependent thing, that's one of the big differences between unity editor vs actual Android device.. if you have code in update, it could be executing less often in android, and maybe never pops the hat up because some condition is different because of the change in frame rate?

1

u/Squiiki May 17 '23

Not anymore, its all been moved to the fixedUpdate method and everything is using fixedDeltaTime too, thanks for the suggestion though!

1

u/NinjaLancer May 17 '23

Check the physics settings tab to see if there is some setting that would be different from android to unity editor? Or maybe on player settings. There are a lot of settings in there, so I forget what might be beneficial to look at off the top of my head..

Good luck!