Version: 2022.1
public GameObject gameObject ;

描述

被该控制器撞击的游戏对象。

using UnityEngine;

public class Example : MonoBehaviour { void OnControllerColliderHit(ControllerColliderHit hit) { // Objects we touch, move them to position (0, 0, 0) hit.gameObject.transform.position = Vector3.zero; } }