camera-systems
ما الذي تفعله
تغطي هذه المهارة سلوك الكاميرا في الألعاب ثنائية الأبعاد وثلاثية الأبعاد، من التتبع السلس إلى الدوران حول الشخصية مع تجنب الجدران. وهي لمطوري الألعاب الذين تهتز كاميراتهم أو تقفز أو تُظهر مناطق خارج المرحلة.
متى تستخدمها
- ✓عندما يجب أن تتبع الكاميرا ثنائية الأبعاد اللاعب بسلاسة وتبقى داخل حدود المرحلة.
- ✓عندما تبني كاميرا من منظور الشخص الثالث تدور حول الشخصية ولا تخترق الجدران.
- ✓عندما تهتز الكاميرا أو تقفز أو تسبب دوارًا للحركة وتحتاج إلى ضبط.
رابط المهارة
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/camera-systems/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“كاميرتي ثنائية الأبعاد تهتز وتُظهر المنطقة خارج حافة المرحلة. هل يمكنك إصلاح سلوك التتبع؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يضيف الوكيل منطقة ميتة وتنعيمًا ونظرة استباقية اختيارية إلى منطق التتبع، ثم يحصر المنظور داخل حدود المرحلة. وفي ثلاثة أبعاد يضيف دوران الكاميرا مع دفعها عند الاصطدام ونقطة ربط لاهتزاز الشاشة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Camera systems
The camera is the player's window; bad camera work makes a good game feel awful. This skill covers the engine-neutral camera techniques — smooth follow, deadzones, look-ahead, bounds clamping, third-person orbit with collision, first-person look, and multi-target framing — and maps them onto each engine's camera node or rig.
When to use
- Use when a 2D camera should follow the player smoothly, stay inside the level, lead the player's motion, or ignore small movements (deadzone).
- Use when building a 3D third-person orbit camera (mouse/stick look, collision push-in) or a first-person look controller, or framing multiple targets at once.
- Use to fix camera jitter, snapping, motion sickness, or a camera that shows past the level edge.
When not to use: for the magnitude and trigger of screen shake and impact juice, use
game-feel (this skill exposes the shake offset hook it drives). For the engine's concrete
camera node/component setup, use godot-3d-essentials (Camera3D, environment) or the engine
skill. For player movement itself use the engine movement skill (godot-2d-movement). For
performance of many cameras/render targets, see performance-optimization.
Core workflow
- Decide what the camera serves. Platformer (lead the jump, see hazards), top-down (center with deadzone), third-person (orbit + collision), first-person (look only). The genre sets the rules.
- Follow smoothly and frame-rate independently. Move the camera toward the target with
exponential smoothing or a spring (
SmoothDamp), not a fixedlerp(a, b, 0.1)— that 0.1 is per-frame and changes with frame rate. - Add a deadzone so tiny target movements don't nudge the camera; it only follows once the target leaves a box/zone. Stops nausea in twitchy games.
- Lead the action with look-ahead by offsetting the camera target in the direction of motion or facing, eased in/out so it doesn't whip.
- Clamp to level bounds so the camera never shows outside the playable area; combine with smoothing so it eases to a stop at the edge.
- For 3D, separate look from collision. Orbit via yaw/pitch on a rig; use a spring arm / ray to pull the camera in when geometry blocks it; clamp pitch.
- Update the camera after the target moves. Follow in the late/post step (after movement and physics resolve) to avoid a one-frame lag jitter.
- Verify by moving the target at low and high frame rates, into corners and walls, and at the level edges; confirm no jitter, no peeking past bounds, smooth stops. Report what you saw.
Patterns
1. Godot 2D built-in follow: smoothing + bounds (don't hand-roll first)
# Godot 4.7 Camera2D. Engine-provided smoothing + hard limits + drag margins.
@onready var cam := $Camera2D
func _ready() -> void:
cam.make_current()
cam.position_smoothing_enabled = true
cam.position_smoothing_speed = 6.0 # higher = snappier; lower = floatier
cam.limit_left = 0; cam.limit_top = 0 # clamp to the level rect (pixels)
cam.limit_right = level_width; cam.limit_bottom = level_height
cam.drag_horizontal_enabled = true # built-in deadzone via drag margins
2. Frame-rate-independent smooth follow (when you hand-roll it)
# RIGHT: exponential smoothing — same feel at any FPS. `rate` ~ 5..12.
func _follow(dt: float) -> void:
var t := 1.0 - exp(-rate * dt) # converges correctly regardless of dt
global_position = global_position.lerp(target.global_position, t)
# WRONG: global_position = global_position.lerp(target.global_position, 0.1)
# → faster smoothing at higher FPS; different feel on every machine.
# Unity 6.3 LTS: Vector3.SmoothDamp(transform.position, target.position, ref vel, smoothTime) in
# LateUpdate gives the same spring behavior with built-in frame-rate correction.
3. Deadzone + look-ahead (lead the player, ignore jitter)
# Camera only chases once the target leaves the deadzone box, then aims AHEAD of motion.
func _camera_target(dt: float) -> Vector2:
var to := target.global_position - _focus
var dz := deadzone_half_extents # e.g. Vector2(48, 32)
# Only move the focus by the overflow beyond the deadzone (per axis).
_focus.x += clampf(absf(to.x) - dz.x, 0, INF) * signf(to.x)
_focus.y += clampf(absf(to.y) - dz.y, 0, INF) * signf(to.y)
var lead := target.velocity.normalized
الأسئلة الشائعة
هل تضيف اهتزاز الشاشة؟
تعرض المهارة نقطة ربط لإزاحة الاهتزاز، لكن قوة الاهتزاز وتوقيته يأتيان من مهارة إحساس اللعب.
هل تغطي كاميرات الشخص الأول؟
نعم. تشمل متحكم نظرة للشخص الأول إلى جانب دوران الشخص الثالث.
هل تغطي عقد الكاميرا في المحرك؟
إعداد كاميرا المحرك تغطيه مهارات الكاميرا في Godot أو Unity، وهذه المهارة تحيل إليها.
التفاصيل
الوصف الأصلي من المؤلف
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 first-person look; plus multi-target framing and a shake hook. Engine-neutral techniques that pair with the engine's camera node and rigs like Unity Cinemachine or Godot Camera2D/PhantomCamera. Use when the user mentions camera follow, follow camera, deadzone, look-ahead, camera smoothing, camera bounds/ limits, third-person camera, orbit camera, first-person look, Cinemachine, or camera jitter.
الشعبية
- نجوم GitHub
- 6.6k
- الترتيب
- #13793
- الترخيص
- Apache-2.0
- آخر تحديث
- 28/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
router
6.6kيساعد وكيلك على اختيار مهارة تطوير الألعاب المناسبة لطلبك، بعد التعرف على المحرك ونوع المهمة التي تحتاجها.
ai-behavior-trees-utility-ai
6.6kيساعد وكيلك على بناء شجرة سلوك ونظام ذكاء اصطناعي بالتقييم لأعداء اللعبة والشخصيات، فتختار الإجراء حسب الأولوية والنقاط.
audio-design
6.6kيعلّم وكيلك مزج صوت اللعبة: المسارات، والديسيبل، وخفض الموسيقى تحت الحوار، والموسيقى المتكيفة، وتنويع المؤثرات الصوتية.
create-game-assets
6.6kيساعد وكيلك على تخطيط مجموعة متناسقة من فن اللعبة وفحصها، من دليل الأسلوب وقائمة الصور إلى قواعد الحجم والتسمية.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.