Skip to content

gamedev-skills/awesome-gamedev-agent-skills / skills/other-engines/roblox-physics

roblox-physics

Verified

Roblox physics and spatial queries: assemblies, constraints, collision groups, Raycast and Shapecast, and network ownership. Use when parts fall through or jitter, Touched is unreliable, a ray hits the shooter, or BodyMovers need replacing. Not for hit legitimacy (`roblox-networking`), Humanoid movement (`roblox-characters`) or engine-neutral tuning (`physics-tuning`).

FileKindSize
SKILL.mdskill md8.6 KB
agents/openai.yamlconfig199 B
references/queries-and-ownership.mdmarkdown3.3 KB

references/queries-and-ownership.md

View on GitHub
# Roblox physics queries, collision policy, and ownership

Read this when designing collision groups, query filters, a physical gameplay object, or a
multiplayer ownership/security test.

## Separate the three flags

`CanCollide` controls physical response, `CanTouch` controls touch event participation, and
`CanQuery` controls spatial-query eligibility (subject to query parameters). Define each by role.
Typical sensor parts do not collide but may touch/query; visual-only geometry may do neither. Use
named collision groups registered on the world (`Workspace:RegisterCollisionGroup()`,
`CollisionGroupSetCollidable()`; a `WorldModel` keeps its own matrix unless
`UseWorkspaceCollisionGroups` is on) and verify the actual matrix in Studio. Registration has a
cost proportional to part count, so register groups at edit time or once at startup. The
`PhysicsService` versions are deprecated.

## Query selection

- `Workspace:Raycast(origin, direction, params)` for the first surface along a segment. Direction
  magnitude is range.
- sphere/block radius/bounds overlap methods for broad volume candidates. Deduplicate assemblies or
  target models and refine if bounding-box false positives matter.
- configure `RaycastParams`/`OverlapParams` with include/exclude instances, collision group, water,
  and result bounds. Reuse params where the filter is stable; update it when character generations
  or streamed containers change.

Query results are evidence, not a whole gameplay authorization. Also validate actor state, team,
cooldown, origin, target membership, and permissions on the server.

## Assembly and ownership debugging

In Studio, inspect `AssemblyRootPart`, `AssemblyMass`, center of mass, anchors, constraints, and the
Network Owners visualization. Test automatic ownership before forcing it. Server ownership protects
simulation authority but can increase server work and latency; client ownership improves response
but requires server validation of consequences.

When a mechanism changes anchor state, re-check ownership because prior ownership state may not be
retained. For vehicles, explicitly decide which occupant should own the assembly and what happens
on seat changes, death, or disconnect.

## Modern motion migration

Map sustained linear control to `LinearVelocity` or `VectorForce`, rotational control to
`AngularVelocity`/`Torque`, and pose following to `AlignPosition`/`AlignOrientation`. Preserve the
old system's coordinate space, force/torque limits, attachment geometry, reaction force, and
ownership behavior; do not replace class names without measuring behavior.

## Verification matrix

Test one part and a welded multi-part assembly; anchored/unanchored transitions; intended collision
group pairs; each Can* flag; fast and slow movers; low/high mass; ray miss/hit/filter edge; overlap
deduplication and max-result behavior; client approaching/leaving automatic ownership; explicit
owner disconnect/death; two clients interacting simultaneously; streaming absence; and complete
temporary-object cleanup. Use server-observed results for gameplay assertions.

## Primary references

- `https://create.roblox.com/docs/physics/assemblies`
- `https://create.roblox.com/docs/physics/network-ownership`
- `https://create.roblox.com/docs/workspace/raycasting`
- `https://create.roblox.com/docs/workspace/collisions`
- `https://create.roblox.com/docs/reference/engine/datatypes/RaycastParams`
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall