Which method is more expensive?

We need manage some collisions for a project focused on small devices (smartphones and tablets), so we’re worried about optimization.

My mates and I, are arguing about two methods to set our static world prefabs.

  • Option 1: World objects have a Collider and Rigidbody component set to “isKinematic”.
  • Option 2: Same as #1, but Rigidbody isn’t Kinematic instead is constrained with all axis.

The second option is more favorable for us to source and behavior issues, but we are concerned it is too expensive. We would like to know if there is much difference in computational cost between these options.

Thanks

You can use the profiler to see the difference

Yeap … I did it and I didn’t notice much difference. But I don’t know if this means there have similar cost or I made bad test. So I prefer ask to other people who may be know much more about it.

A second opinion :).

I suspect that Kinematic is cheaper, as all physics calculations are bypassed on Kinematic objects. In my own testing, I’ve discovered this isn’t necessarily the case with objects that only have their axes constrained. They will still move a very small (float rounding error, probably) amount when interacting with other rigidbodies or forces.

Probably the best thing to focus on, though, is using primitive colliders whenever possible, and make sure these static objects don’t touch non-static objects most of the time, so the physics engine can just put them to sleep.

test it, it’s the only way. First make the game, then worry about optimisation. If it means you need to recode something, then so be it, recode that part. It’s a day’s work at most when unity is doing the heavy lifting.

Thanks for replies :).

After all, we found a method to manage our characters without usage of “isKinematic”.