ai-behavior-trees-util…
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators)…
Implement Roblox physical simulation and queries with assemblies, anchoring, constraints, collision groups, CanCollide/CanTouch/CanQuery, raycasts and overlap queries, mass, impulses, forces, velocity, moving assemblies, cleanup, and network ownership. Use for Roblox collisions,
Claude Code
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics --agent claude-code
Codex
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics -a codex -y
Cursor
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics -a cursor -y
Gemini CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics -a gemini-cli -y
GitHub Copilot
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics -a github-copilot -y
OpenCode
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics -a opencode -y
Windsurf
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics -a windsurf -y
name: roblox-physics description: > 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`).
Simulation, character control, hit detection and visual-only motion are different jobs. Pick the mechanism first, then the API. Whether a hit counts is a server validation decision owned by `roblox-networking`; this skill supplies the queries it uses.
| Goal | Mechanism | |---|---| | sustained physical interaction | unanchored assembly plus modern constraints or forces | | one-off physical change | `ApplyImpulse` / `ApplyAngularImpulse` | | kinematic platform or path | scripted pivot or CFrame with an explicit passenger policy | | character locomotion | Humanoid or Character Controller Library (`roblox-characters`) | | hit test | server raycast, shapecast, or overlap with explicit filters | | cosmetic trail or recoil | local visual motion; no gameplay authority |
1. **Inspect the mechanism.** In Studio, turn on the assembly, constraint and network-owner visualizations; or read `part.AssemblyRootPart`, `part.AssemblyMass`, `part.Anchored` and `part:GetNetworkOwner()` from code. Identify the assembly root and who should own it. 2. **Write the interaction policy.** A collision-group matrix, then `CanCollide`, `CanTouch` and `CanQuery` decided separately per role. Register groups once with `Workspace:RegisterCollisionGroup()` and `CollisionGroupSetCollidable()` (or the Collision Groups editor), from a single script so assignment never races registration. 3. **Choose simulation or query.** A ray for a line, a shapecast for a moving volume, an overlap for a static volume, and simulation contacts only when a physical response is wanted. `.Touched` is neither reliable nor secure as a hit detector. 4. **Apply motion at assembly level.** Forces on any part act on the whole assembly. Use `LinearVelocity`, `AngularVelocity`, `VectorForce`, `AlignPosition` and `AlignOrientation`; migrate BodyMovers when you touch that system. 5. **Set ownership deliberately.** Server-own gameplay-critical loose assemblies when needed; client ownership improves response but never authorizes results. 6. **Bound cost and lifetime.** Reuse query params, cap query frequency and result counts, and destroy temporary constraints, attachments and connections together. 7. **Check from code.** With the Studio MCP server connected, start play and use `execute_luau` on the `Server` datamodel to print the facts the change depends on: `AssemblyRootPart`, `AssemblyMass`, `GetNetworkOwner()`, `workspace:CollisionGroupsAreCollidable(a, b)`, and the result of one test query; then read `get_console_output`. Without MCP, ask the user to run the same snippet from the Command Bar during play and paste the Output. Fast movers, ownership hand-off and two-client interaction need a Server & Clients run.
local Workspace = game:GetService("Workspace")
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {shooterCharacter}
params.IgnoreWater = true
params.CollisionGroup = "WeaponQuery"
local direction = aimDirection.Unit * MAX_RANGE -- direction length is the range
local result = Workspace:Raycast(muzzlePosition, direction, params)
if result then
local model = result.Instance:FindFirstAncestorOfClass("Model")
local humanoid = model and model:FindFirstChildOfClass("Humanoid")
if humanoid and serverCanDamage(shooter, model, result.Position) then
humanoid:TakeDamage(serverWeaponDamage(shooter))
end
end`muzzlePosition` and `aimDirection` must come from server-known character and weapon state. A raycast from a client-supplied origin is not validation (see `roblox-networking`).
local params = OverlapParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {sourceCharacter}
params.CollisionGroup = "DamageQuery"
params.MaxParts = 64
local seen: {[Model]: boolean} = {}
for _, part in Workspace:GetPartBoundsInBox(hitboxCFrame, hitboxSize, params) do
local model = part:FindFirstAncestorOfClass("Model")
if model and not seen[model] then
seen[model] = true
validateAndApplyHit(model)
end
endBounds queries test bounding boxes and return several parts per target, so deduplicate by model. `WorldRoot:GetPartsInPart()` is exact but costs more. `OverlapParams.RespectCanCollide` switches the query from `CanQuery` to `CanCollide`; set it on purpose or it silently overrides the flag policy.
assembly. One anchored part anchors the whole assembly.
for critical objects, then measure the server cost and responsiveness. Re-check ownership after anchoring changes; it is not always kept.
consequential hits, positions, timing and permissions independently.
assemblies with rollback. Drive predicted forces and constraints from `RunService:BindToSimulation()` on both sides, not from `Heartbeat` or client-only scripts, and expect custom physics scripts to need cha
<img src="docs/assets/awesome-gamedev-agent-skills-banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators)…
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via…
Build game cameras that feel good — 2D follow with a deadzone, look-ahead, smoothing, and level-bounds clamping; 3D third-person…
Plan, generate, source, normalize, and validate cohesive visual game assets. Use for art direction, style bibles, sprites,…
Build branching dialogue and narrative — a node/choice graph with conditions, variables, and localization hooks — and choose…
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A* pathfinding —…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.