Puzzle #2 — Sword Key Unlocks a Moving Door — XR Multiplayer Template
في الحلقة دي هنعمل اللغز التاني في غرفة الهروب: السيف اللي بيشتغل كمفتاح.
الفكرة إن اللاعب يمسك سيف ويحطه في Socket، وبمجرد ما يتحط صح يفتح باب متحرك (Linear Drive).
اللي هنتعلمه:
إزاي نعمل Socket يستقبل أوبچكت معين (السيف).
إزاي نربط دخول السيف في السوكيت بفتح باب متحرك.
إزاي نتحكم في Colliders اللي بتتحرك مع الباب في Multiplayer.
إزاي السيرفر يفضل هو Authority، والكلاينتس يشوفوا التغيير لحظيًا.
إزاي Late Join يدخل ويلقى حالة الباب والسيف مزبوطة.
⚠ ️ ملاحظة: لازم يكون عندك خبرة سابقة مع XR Interaction Toolkit. مش هنعيد شرح الأساسيات.
🇬🇧 English
In this episode we build the second puzzle of the escape room: the Sword as a Key.
The idea is simple: the player grabs a sword, places it into a socket, and when it’s inserted correctly a moving door (Linear Drive) unlocks.
What you’ll learn:
How to implement a socket that only accepts a specific object (the sword).
How to trigger a moving door when the sword is placed correctly.
How to handle moving colliders with Netcode in multiplayer.
Ensuring the server remains authoritative while clients see smooth updates.
How late joiners sync correctly with the door and sword state.
⚠ ️ Note: This tutorial assumes prior experience with XR Interaction Toolkit. Basics are not covered.
Contact me https://www.linkedin.com/in/ahmed-abdailla/a
ahmed.mousa.aed@gmail.com