# Physics in IPhone

**URL:** <https://discussions.unity.com/t/physics-in-iphone/400740>\
**Category:** Mobile\
**Tags:** iOS\
**Created:** [November 2, 2009, 6:18pm UTC](https://discussions.unity.com/t/physics-in-iphone/400740 "2009-11-02T18:18:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon\_63417790](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@anon\_63417790](https://discussions.unity.com/u/anon_63417790)\
**Post date:** [November 2, 2009, 6:18pm UTC](https://discussions.unity.com/t/physics-in-iphone/400740/1 "2009-11-02T18:18:15Z")

</div>

I am just getting ready to start a project that will require physics for the unity on the IPhone. And does anybody have any experience with how far you can take this before the IPhone chokes on it?

---

<div class="post-metadata">

**Author:** ![JRavey](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@JRavey](https://discussions.unity.com/u/JRavey)\
**Post date:** [November 2, 2009, 6:35pm UTC](https://discussions.unity.com/t/physics-in-iphone/400740/2 "2009-11-02T18:35:09Z")

</div>

It really depends on how you are using the physics, for starters. For example, in my project there are about 90 objects with collision meshes which are static and between two and five which are not static, I have no slowdowns with my project personally. However, that is not to say that I could have the inverse and still find the results to be acceptable.

Also, since physics parameters are tunable, it matters a lot on how you tune your physics.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/system/32/97283_2.png) [@system](https://discussions.unity.com/u/system)\
**Post date:** [November 2, 2009, 7:00pm UTC](https://discussions.unity.com/t/physics-in-iphone/400740/3 "2009-11-02T19:00:08Z")

</div>

I think the physics work pretty well in my HyperBowl apps, which have numerous static mesh colliders and of course a bowling ball and ten pins as dynamic colliders. HyperBowl Rome in addition has vases and blocks you can knock over. There is definitely a slowdown when you hit the pins and a bunch of them start colliding and falling, but I think it’s acceptable (my bottleneck is still the rendering). I could increase the fixed timestep as suggested in the Unity iPhone doc, but I’ve been conservative.

I have experienced problems with physics before but it was all user error - my first version of HyperBowl scaled physics global parameters way down to accomodate scaled down geometry and the pins just didn’t fall down reliably, so I’d recommend not messing around too much with those values. I also created a FuguTilt app largely to see how many bouncing balls it could handle, and it only behaved badly at first (balls falling through) because I didn’t make the “paddle” kinematic.

---

<div class="post-metadata">

**Author:** ![anon\_63417790](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@anon\_63417790](https://discussions.unity.com/u/anon_63417790)\
**Post date:** [November 2, 2009, 7:15pm UTC](https://discussions.unity.com/t/physics-in-iphone/400740/4 "2009-11-02T19:15:17Z")

</div>

This is all very encouraging, I have been working on a 2D game, and the physics has been working surprisingly well for it.

---

<div class="post-metadata">

**Author:** ![Pheck](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@Pheck](https://discussions.unity.com/u/Pheck)\
**Post date:** [November 2, 2009, 7:45pm UTC](https://discussions.unity.com/t/physics-in-iphone/400740/5 "2009-11-02T19:45:01Z")

</div>

your physics performance will be largely defined by what you are doing with physics per frame. I would target 10 or less active objects moving via physics at one time. but you can have more than that in the level “active”. PhysX will put objects that are not moving to “sleep” which will remove their perf overhead so you can have a lot more of them.

in my game I had enemies setup in two ways, one moved them with physics impulses etc. and the other just updated their location. by updating their location and just making them colliders that move i can have 20+ of them. by having them as physics objects being moved via impulses etc. I can have about 8+ of them. I made the enemies move via position update and the player move via physics and rockets move via physics. this allowed me to have 10-15 enemies and a good feeling player with good rockets.

another less talked about optimization is to watch the bounds size of your objects. good game code (which i am sure unity is doing) will first check for the bounds of objects before moving onto complex checks. if all of your objects are large and have overlapping bounds then you will be checking basic settings for every object every frame. this could run slow. if you had the same objects far apart and it was only checking bounds on a few pieces the same game could run fast.  
whats important to remember is that objects will do a basic check with physics if they are inside the bounds but if they are outside they will not.
