2

We can think of collisions between a square and a circle as a collision between a rounded square and a point. Effectively, we strip off all the "round stuff" making up the disc, and add it onto the square instead (an operation called Minkowski addition). If the the remaining center point of the circle is inside the rounded square, then the original square ...


2

To make the if condition apply to both lines, put braces around them like this: void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Cube") { Destroy(collision.gameObject); Destroy(gameObject); } } Note: get in the habit of always using braces with if-, while-, and for-statements to make it explicitly ...


1

Collisions are part of the physics update, which is typically handled in the fixed timestep loop (what you call "tick" here). By handling collision detection and resolution at a fixed game time interval, you help ensure that the physics play out consistently even on very different hardware. If you do physics on a variable timestep (like in the render loop),...


1

A mesh collider is not the best solution here. For one, they're unnecessarily expensive for collision with a flat ground plane. You're searching a polygon soup for a collision when you could be doing a cheap primitive check. Second, a (non-convex) mesh is infinitely thin — it has no inside/outside that the physics engine can use to detect penetration. So ...


1

I ended up not "keeping the particles together" as I originally wanted because it made literally no sense computation-wise but using a bitmap of a white silhouette on a black background as a mask for each of the spaceship modules instead. A whole ship would be made of an array of those bitmaps stuck together. Whenever a module got hit I'd render an irregular ...


Only top voted, non community-wiki answers of a minimum length are eligible