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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-physics/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“مقذوفي في Roblox يمر عبر الجدران، كيف أجعله يصطدم بها بموثوقية؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تساعد المهارة الوكيل على اختيار الآلية المناسبة لكل هدف، مثل المحاكاة الفيزيائية أو الدفعات الفورية أو فحوص الإصابة على الخادم، وضبط قواعد التصادم والاستعلام بما يناسب التصميم.

المحتوى التقني (ملف 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 قد يكون غير موثوق وقابلًا للاستغلال، لذلك تفضّل فحوص الأشعة أو التداخل على الخادم.

هل تغطي حركة الشخصية؟

لا. حركة Humanoid تغطيها مهارة شخصيات 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
آخر تحديث
28‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة