I’m creating my first game with Unity2D. After doing a lot of tutorials I still don’t really see why I would need Colliders and RigidBodies in my 2D game. All online tutorials seem to assume you always need physics?
What’s so bad about NOT working with colliders and rigidbodies? Will the performance of my game be worse if I don’t use them?
Or will performance improve by leaving out 2D physics?
Currently I am just moving all my GameObjects by setting their transform.position directly, and then checking their bounds to see if they collide with anything. For example: (this is just a quick example to show how to work without physics)
public GameObject ship;
public GameObject enemy;
void Update () {
if (ship.GetComponent<SpriteRenderer>().bounds.Intersects(enemy.GetComponent<SpriteRenderer>().bounds)) {
Debug.Log ("enemy hits ship");
}
}