thisArticulationBody
The ArticulationBody of the collider of the GameObject which received the Collision event (Read Only).
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
public ArticulationBody thisArticulationBody { get; }
Remarks
The ArticulationBody of the collider of the GameObject which received the Collision event. If there is no articulation body attached, this returns .
nullExamples
using UnityEngine;public class ExampleScript : MonoBehaviour{ // Make all articulation bodies that your GameObject hits move to the left``` void OnCollisionStay(Collision collision) { // Check if the collider your GameObject hits has an articulation body // Then apply the force if (collision.thisArticulationBody) { collision.thisArticulationBody.AddForce(Vector3.left * 15); } }}