10

The collision event represents a physics overlap that causes a collision resolution, altering the behaviour of one or both objects involved to make them bounce apart rather than pass through one another. Collision resolution can only happen when one of the bodies involved is a dynamic Rigidbody. So this isn't a limitation of the collision event, this is ...


3

Imagine you want a dent in a car or want to collide two cars into eachother. How will you determine impact/hit force ? Trigger doesn't return these functionalities


2

Perhaps you would like something akin to portal: The cubes you can pick up have collision responses to everything to play scraping noises etc. However the cubes only disappear when they pass through the blue light wall trigger volumes.


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 ...


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 ...


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 ...


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 ...


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