ThirdPersonController collision not calling OnTriggerEnter event

后端 未结 2 1402
醉话见心
醉话见心 2021-01-28 15:45
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour {

    public Transform target;

    // Update is calle         


        
2条回答
  •  生来不讨喜
    2021-01-28 16:36

    ThirdPersonController uses CharacterController and OnControllerColliderHit is used for that not OnTriggerEnter.

    Note that you must move it with the Move function not directly by its transform in order for OnControllerColliderHit to be called.

    void OnControllerColliderHit(ControllerColliderHit hit)
    {
    
    }
    

提交回复
热议问题