ai-behavior-trees-util…
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
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,
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-physics --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/roblox-physicsContext preview
The summary Claude sees to decide when to auto-load this skill.
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,
name: roblox-physics description: > 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, hit detection, RaycastParams, PhysicsService, projectiles, vehicles, knockback, constraints, deprecated BodyMovers, unstable motion, or client-owned physics exploits.
Choose deliberately between simulation, character control, hit detection, and visual-only motion; they are different jobs. Targets Roblox's rolling platform APIs. Pair with `physics-tuning` for engine-neutral stability and feel.
impulses, moving physical objects, network ownership, or physics cleanup.
when anchored, or old BodyMover patterns appear.
**When not to use:** ordinary Humanoid lifecycle/control belongs to `roblox-characters`; remote validation belongs to `roblox-networking`; decorative UI/world motion may only need a tween.
| Goal | Mechanism | |---|---| | sustained physical interaction | unanchored assembly + modern constraints/forces | | instantaneous physical change | `ApplyImpulse` / `ApplyAngularImpulse` | | kinematic platform/path | controlled pivot/transform with an explicit passenger policy | | character locomotion | Humanoid/custom character controller (`roblox-characters`) | | authoritative hit test | server raycast/overlap with filters and gameplay validation | | cosmetic trail/recoil | local visual motion; no gameplay authority |
1. **Inspect the mechanism.** In Studio, visualize assemblies, anchors, constraints, collision groups, massless parts, and network owners. Identify the assembly root and intended authority. 2. **Define interaction policy.** Write the collision-group matrix and separately decide `CanCollide`, `CanTouch`, and `CanQuery`. These flags are not interchangeable. 3. **Choose simulation or query.** Do not use `.Touched` as a universal hit detector. Use a ray for a path/line, an overlap query for a volume, and simulation contacts when physical response is actually required. 4. **Apply motion at assembly level.** Forces on a part affect its assembly. Use modern `LinearVelocity`, `AngularVelocity`, `VectorForce`, `AlignPosition`, and `AlignOrientation` constraints as appropriate; migrate deprecated BodyMovers when changing that system. 5. **Set ownership deliberately.** Server-own gameplay-critical loose assemblies when required; client ownership can improve responsiveness but never authorizes gameplay results. 6. **Bound cost and lifetime.** Reuse query parameters, cap query frequency/result count, remove temporary constraints/attachments, and disconnect event listeners. 7. **Verify under load and multiplayer.** Test anchored/unanchored transitions, mass extremes, collision matrix, fast motion, multiple clients, ownership changes, streaming, and cleanup.
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
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
endThe server must validate the origin/direction against server-known character/weapon state; do not accept an arbitrary client origin and treat the raycast itself as validation.
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 use bounding boxes and can include multiple parts from one target; deduplicate and perform exact/gameplay checks as needed. For exact geometry use `WorldRoot:GetPartsInPart(part, overlapParams)` only when its additional cost is justified. Note `OverlapParams.RespectCanCollide` decides whether a query honours `CanCollide` or `CanQuery` — set it deliberately, or it silently overrides the flag policy below. `OverlapParams.Tolerance` controls contact slop.
that assembly. Anchoring a part changes simulation/ownership and can make an assembly effectively infinite mass.
Setting `AssemblyLinearVelocity` is an immediate state change, not a continuous force model.
other deprecated BodyMovers when authoring or revising a mechanism.
`SetNetworkOwner(nil)` conservatively for critical objects, then measure responsiveness/server cost. Visualize network owners in Studio.
<img src="docs/assets/banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Repo: gamedev-skills/awesome-gamedev-agent-skills
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via layering and re-sequencing, SFX…
Build game cameras that feel good — 2D follow with a deadzone, look-ahead, smoothing, and level-bounds clamping; 3D third-person orbit with collision and…
Plan, generate, source, normalize, and validate cohesive visual game assets. Use for art direction, style bibles, sprites, tilesets, backgrounds, UI art,…
Build branching dialogue and narrative — a node/choice graph with conditions, variables, and localization hooks — and choose between authoring tools Ink and…
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A* pathfinding — engine-neutral algorithms that pair…