【发布时间】:2017-05-14 00:12:00
【问题描述】:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour {
public Transform target;
// Update is called once per frame
void Update ()
{
}
private void OnTriggerEnter(Collider col)
{
if (col.gameObject.tag == "Test")
{
this.transform.position = target.position;
}
}
}
我有一个 ThirdPersonController,我希望它与立方体或圆柱体发生碰撞。 该脚本附加到 ThirdPersonController。
我尝试向圆柱体或立方体添加刚体,打开/关闭使用重力和运动学,但没有。它没有参加活动。
【问题讨论】: