两个角色控制器之间的碰撞

发布于 2024-12-06 11:04:09 字数 74 浏览 1 评论 0原文

大家好,我是团结的新人。我在我的项目中创建了两个角色。他们可以轻松移动。但问题是我不能让它们发生碰撞。请帮我。给我一些代码......

Hello everyone I am new in unity. I create two character on my project. They can move easily. But the problem is I cannot make collision between them. Please help me. Give me some code.....

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゝ杯具 2024-12-13 11:04:09

首先,您想要“让”刚体碰撞还是检测碰撞?

假设后者主要是目标,碰撞检测是一个非常广泛的主题,在不知道您面临的问题到底是什么的情况下很难给出准确的答案,并且由于您正在学习,我将提供一些链接应该有助于理解和实现 Unity3d 中的碰撞检测。

为了进行碰撞检测,您需要研究光线投射。其次,关于您的具体问题(冲突的角色控制器),无法提供任何代码,因为您没有提供有关您的游戏环境以及您创建的内容的任何详细信息,但是 应该会有所帮助(研究标题“字符控制器”),但请详细研究碰撞和碰撞检测的基础知识。

和链接:

希望这有帮助。

以后一定要提到你的具体问题,以及到目前为止你做了什么,或者如果你想开始学习,请清楚地提到你想学什么。

First, do you want to 'make' ridigbodies collide or detect the collision?

Assuming the latter because that is mostly the objective, collision detection is a very wide topic, and it is difficult to give an exact answer without knowing what exactly is the problem you are facing, and since you are learning, i am giving some links which should be helpful in understanding and implementing collision detection in Unity3d.

What you need to study in order to do collision detection is Raycasting. Second, about your specific problem (colliding character controllers) no code can be give since you didn't give any details about your game environment and what have you created, but this should be helpful (study the heading Character Controllers), but do study the basic of collisions and collision detection in detail.

and the links:

Hope this helps.

In future do mention your specific problem, and what you have done so far, or if you want to start learning, do mention clearly what you want to learn.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文