Version: 2021.1
언어: 한국어
public Rigidbody rigidbody ;

설명

The rigidbody that was hit by the controller.

Null if we didn't touch a rigidbody but a static collider.

using UnityEngine;

public class Example : MonoBehaviour { // Activate the gravity of other object we touch void OnControllerColliderHit(ControllerColliderHit hit) { if (hit != null) { hit.rigidbody.useGravity = true; } } }