How do I properly set up game objects for collision handling?

Hi everyone,

I’ve been playing around with Unity mobile for a while and wanted to ask some questions regarding the ‘best practise’ of how one should properly handle collision between different game objects.

I have a player (rigidbody attached), lots of enemies (rigidbodies attached) and lots of bullets (rigidbodies attached). I don’t need any physics effects, except from gravity (and collision which is handled by the physics engine afaik?). Is this a good approach for a mobile game? Give everything that is moving in the game scene a rigidbody?

I’ve been reading that rigidbodies can be very expensive and should only be used when necessary, especially on mobile. I just wanted to know if there might be a better way to implement this simple scene without the use of so many rigidbodies all at once? At any one time, there could be 15-25 rigidbodies on screen (there probably will be some more off screen, so let’s say a total of like 40 max). Is there a better way than using rigidbodies for a simple collision detection and the use of gravity?

I hope this makes sense. Thank you in advance.

if you want to reduce physics calculations, you can declare the player with character controller instead of rigibody. Also, you can make just bullets use rigidbody as the collisions require only one of the colliding objects to have rigidbody and also because you have to add force to them on shoot.
Character controller, if you use CharacterController.move, doesn’t care for gravity. You have to add it manually. Or you can use CharacterController.SimpleMove, which takes gravity into the count, but doesn’t care for velocity along Y-axis.
Note: Be careful not to call move/simplemove more than once per frame as it can be expensive. Calculate all the movement you want and apply it only once.