【发布时间】:2020-04-15 16:32:14
【问题描述】:
我正在制作一个游戏,我试图让 Ethan (AIThirdPersonController) 走到用户所在的地方。用户通过查看他们想去的地方移动,然后单击按钮开始和停止。 我为 ethan 编写的代码可以去任何用户所在的地方是这样的:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class LookMoveTo : MonoBehaviour
{
public GameObject MeMyselfEye;
void Update()
{
transform.position = MeMyselfEye.transform.position;
}
}
MeMyselfEye 是拥有主摄像机和角色控制器的游戏对象 enter image description here 这是我的 MeMyselfEye 游戏对象的图像 enter image description here 这是我的 walkTarget 游戏对象的图像,其中包含 LookMoveTo 脚本。 如果有人知道如何让 Ethan 跟随/走到 VR 耳机中的玩家所在的任何地方,请告诉我,谢谢!
这些是 ethan 检查器面板的图像
enter image description here.imgur.com/uCjFu.jpg enter image description here
这是 MeMyselfEye 的检查面板 enter image description here
【问题讨论】:
-
对不起,我忘了补充说 Ethan 角色确实会移动,当他奔跑时,他试图去一个特定的点,然后就停在那里。无论我将他移动到哪里,即使 MeMyselfEye 游戏对象在用户四处移动时不断移动其位置,它始终是一个点
-
我们能否查看
ethan和memyselfeye的检查员详细信息? -
@Jake 我现在就添加它们
标签: c# unity3d unity3d-ui