我如何在VR中添加一个对象,并像手一样移动

发布于 2025-02-11 18:12:32 字数 243 浏览 1 评论 0原文

我正在开发VR游戏,想按下一个按钮,以便游戏对象在我的手中产生并取代我的手,以便它像它一样移动。我尝试过这样的尝试:

 public Transform handSpawn;
 Instantiate(objectToSpawn, handSpawn.position, handSpawn.rotation);

对于Handspawn,我试图将控制器本身,模型和锚点拿走,但这些都没有完成。我使用XR工具包

I am developing a VR game and I want to press a button so that a GameObject spawns in my hand and replaces my hand so that it moves like it. I tried it like this:

 public Transform handSpawn;
 Instantiate(objectToSpawn, handSpawn.position, handSpawn.rotation);

For handSpawn I tried to take the controller itself, the model, and an anchor but neither of those did the job. I use the XR Toolkit

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文