본문으로 건너뛰기
Skillpedia
일반 코딩6.6k · #13840

roblox-physics

하는 일

이 스킬은 Roblox 파트가 떨어지고, 충돌하고, 발사체에 맞는 것처럼 물리적으로 움직이게 하는 방법을 설명합니다. 차량, 발사체 또는 움직이는 객체를 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Roblox에서 파트가 떨어지거나, 튕기거나, 충돌하거나, 힘을 받아 움직여야 할 때.
  • ✓발사체나 피격 감지가 Touched에 의존하지 않고 안정적으로 작동하기를 원할 때.
  • ✓오래된 BodyMover 스크립트나 제약된 객체가 깨지거나 불안정할 때.

스킬 링크

https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-physics/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-physics/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 Roblox 발사체가 벽을 통과해요. 벽에 확실히 부딪히게 하려면 어떻게 해야 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

각 목표에 맞는 방식(물리 시뮬레이션, 즉각적인 충격, 서버 피격 확인 등)을 고르고, 설계에 맞는 충돌 및 쿼리 규칙을 설정하도록 돕습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Roblox physics

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.

When to use

  • Use for BasePart assemblies, constraints, collision/query policy, ray/overlap queries, forces, impulses, moving physical objects, network ownership, or physics cleanup.
  • Use when Touched is unreliable/security-sensitive, parts tunnel or jitter, a mechanism breaks 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.

Decide the system first

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

Workflow

  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. Register groups in the Studio Collision Groups editor or with Workspace:RegisterCollisionGroup() and Workspace:CollisionGroupSetCollidable(); the PhysicsService collision-group methods are deprecated and forward to Workspace.
  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.

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
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

The 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.

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 use bounding boxes and can include multiple parts from one ta

자주 묻는 질문

피격 감지에 Touched를 쓰지 않는 이유는 무엇인가요?

이 스킬은 Touched가 신뢰할 수 없고 악용될 수 있다고 설명하며, 그래서 서버 레이캐스트나 겹침 확인을 선호합니다.

캐릭터 이동도 다루나요?

아니요. 휴머노이드 이동은 별도의 Roblox 캐릭터 스킬에서 다룹니다.

물리 느낌을 조정하는 것도 다루나요?

일부만 다룹니다. 엔진과 무관한 조정은 별도의 물리 조정 스킬에서 다룹니다.

상세 정보

작성자의 원본 설명

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.

repo: gamedev-skills/awesome-gamedev-agent-skills

인기도

GitHub 스타
6.6k
순위
#13840
라이선스
Apache-2.0
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬