← Back to MonoGame · project planning pack

Skill · Version 1.0.0

Unity combat physics

Makes Unity hits reliable by coordinating movement, collision queries and damage ownership. Handles fast projectiles and multi-collider characters without applying the same attack more than once.

unity-combat-physics

Agents using this skill

See how it helps

When is it useful?

Use it when fast projectiles miss targets or pooled and multi-collider objects produce duplicate or stale damage.

What does it help you do?

  • Reproduces tunneling before selecting continuous collision or swept queries.
  • Resolves multiple colliders to one damageable actor.
  • Resets pooled projectile hit records, velocity and delayed callbacks.

Try asking this

Fix arrows passing through thin targets in a Unity arena. Reproduce the miss at the intended speed, choose a supported collision or swept-query approach and map several body colliders to one target. Reuse the arrow from a pool and verify one hit, fresh velocity and no delayed damage from its previous flight.

Detailed documentation

Read the skill’s original instructions, examples and checks in their authored language.

Details…Show less

Combat Physics and Hit Detection

Inspect Unity version, 2D versus 3D physics, fixed step, time scaling, layers, movement authority and actual projectile speed/size. State what counts as one hit and who may apply damage.

  • Reproduce tunneling at the real speed and thinnest intended collider. Start with the existing collision mode; choose supported continuous detection or a swept query when measurement warrants it. CCD is not a guarantee for every body shape, trigger or moving target.
  • Physics movement and forces belong to their simulation contract. Avoid render-frame-dependent impulses and direct transform writes that compete with a simulated Rigidbody. Evaluate interpolation separately from authoritative collision.
  • Use explicit query masks and trigger policy. Filter the shooter, allies and already-hit targets according to the mechanic. Resolve a collider to the owning damageable entity so a multi-collider actor is not damaged repeatedly by one intended hit.
  • For pooled projectiles, reset hit registries, velocity, lifetime, ignored collision pairs, ownership and delayed callbacks. A callback from a previous lifetime must not affect a reused projectile.
  • Bound non-allocating query buffers and handle saturation; a full buffer is not proof that all hits were returned. Do not assume unsorted query results are distance ordered.
  • Diagnose fixed steps per frame and catch-up spikes before shrinking the fixed timestep. Check collision callbacks, queries and allocations at representative projectile counts.

Verify thin-wall hits, moving targets, repeated contacts, pause/slow motion, pooled reuse, friendly-fire rules and a dense encounter. Record observed misses and CPU cost; do not claim universal CCD reliability.

Reference: the project-version Unity physics manual. The upstream skill's helper scripts and performance numbers are not installed or independently verified here.

Included files 2

  • LICENSE.txt
  • SKILL.md