المتصادم في يونتي و انواع المتصادمات

Опубликовано: 29 Июнь 2026
на канале: Rasha Saad aldeen
940
52

يعد Box Collider أحد أكثر المصادمات استخدامًا. باستخدام خصائصه ، يمكنك تحديد ما إذا كان هذا المصادم اذا كان trigger او لا وتحديد مركزه وحجمه. بالإضافة إلى ذلك ، يمكنك إرفاق مادة فيزيائية تحدد معامل الاحتكاك والارتداد . يمكنك التحكم في كل هذه الخصائص في inspector وكذلك في نص C #. فيما يلي بعض نماذج التعليمات البرمجية التي تتحكم في هذه الخصائص
متصادم الكرة. يمكن التحكم في المادة ، وموضع المركز وخصائص نصف القطر ، وهناك مصادم آخر مهم هو مصادم الكبسولة. مثل مصادم الصندوق ومصادم الكرة ، يمكنك التحكم في خصائص مثل المركز ونصف القطر والارتفاع. يمكنك تخصيص مادة فيزيائية ، وكذلك تغيير الاتجاه. تغير خاصية الاتجاه اتجاه المصادم. يستخدم المطورون بشكل عام مصادمات الكبسولة للأحرف. مصادم الشبكة هو نوع من المصادم له نفس الهندسة مع الشبكة المرتبطة. هذا يسمح لمحرك الفيزياء بإجراء حسابات تصادم دقيقة للغاية. ومع ذلك ، كما ذكرت أعلاه ، يجب أن تضع في اعتبارك أن استخدام مصادم الشبكة مكلف ويجب تجنب استخدامه إن أمكن. بدلاً من ذلك ، يجب أن تفكر في استخدام مجموعة من المصادمات البدائية.
Box Collider is one of the most used colliders. By using its properties, you can determine if this collider is a trigger or not (do not worry about triggers yet, we will see it in detail later) or its center and size. In addition, you can attach a physics material that specifies the friction coefficient and bounciness (we will see physics materials in a minute). You can control all these properties in the inspector as well as in C# script. Here are some code samples that control these properties:The second collider that we will see is the sphere collider. You can control its IsTrigger, material, the position of center and radius propertiesAnother important collider is the capsule collider. Like box collider and sphere collider, you can control properties like center, radius, and height. You can assign a physics material, and also change the direction. Direction property changes the orientation of the collider. Developers generally use capsule colliders for characters.Mesh collider is a type of collider that has the same geometry with the mesh that is associated. This allows the physics engine to make very accurate collision calculations. However, as I mentioned above, you should keep in mind that using mesh collider is expensive and you should avoid using it if possible. Instead, you should consider using a combination of primitive colliders.
لمحة:
قناتي متخصصة في البرمجة وتطوير الألعاب
استخدم محرك يونتي
انستغرام
  / rasha_saad_aldeen  
يوتيوب
   / rashasaadaldeen  
فيسبوك
  / rashasaadaldeenofficial  
دورة برمجة
   • برمجة لعبة قتالية ثلاثية الأبعاد - برمجة ا...  
برمجة الالعاب