using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BetweenPoint : MonoBehaviour {
public Transform pos1;
public Transform pos2;
public Transform betPre;
// Use this for initialization
Vector3 betweenPos;
// Update is called once per frame
void Update () {
betweenPos = (pos1.position + pos2.position) / 2;
betPre.position = betweenPos;
}
}
测试结果: