roblox-physics
БесплатноБез исполняемых скриптовНе проверенRoblox physics and spatial queries: assemblies, constraints, collision groups, Raycast and Shapecast, and network ownership. Use when parts fall through or…
от gamedev-skills★ 12 656 звёзд на GitHubОб этом скилле
Roblox physics
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.
Decide the mechanism
| 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 |
Workflow
- Inspect the mechanism. In Studio, turn on the assembly, constraint and network-owner
visualizations; or read
part.AssemblyRootPart,part.AssemblyMass,part.Anchoredandpart:GetNetworkOwner()from code. Identify the assembly root and who should own it. - Write the interaction policy. A collision-group matrix, then
CanCollide,CanTouchandCanQuerydecided separately per role. Register groups once withWorkspace:RegisterCollisionGroup()andCollisionGroupSetCollidable()(or the Collision Groups editor), from a single script so assignment never races registration. - 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.
.Touchedis neither reliable nor secure as a hit detector. - Apply motion at assembly level. Forces on any part act on the whole assembly. Use
LinearVelocity,AngularVelocity,VectorForce,AlignPositionandAlignOrientation; migrate BodyMovers when you touch that system. - Set ownership deliberately. Server-own gameplay-critical loose assemblies when needed; client ownership improves response but never authorizes results.
- Bound cost and lifetime. Reuse query params, cap query frequency and result counts, and destroy temporary constraints, attachments and connections together.
- Check from code. With the Studio MCP server connected, start play and use
execute_luauon theServerdatamodel to print the facts the change depends on:AssemblyRootPart,AssemblyMass,GetNetworkOwner(),workspace:CollisionGroupsAreCollidable(a, b), and the result of one test query; then readget_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.
Pattern: filtered server raycast
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).
Pattern: overlap volume with explicit policy
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
end
Bounds 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.
Assemblies, force, and ownership
- Welded parts form one rigid assembly; force, impulse, velocity, mass and ownership act on the assembly. One anchored part anchors the whole assembly.
- Tune forces and impulses from intended acceleration times
AssemblyMass, not by trial values. - Automatic ownership moves nearby unanchored assemblies to clients. Call
SetNetworkOwner(nil)for critical objects, then measure t
Установить roblox-physics в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл roblox-physics?
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`).
Как установить скилл roblox-physics?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл roblox-physics запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic