两个角色控制器之间的碰撞
大家好,我是团结的新人。我在我的项目中创建了两个角色。他们可以轻松移动。但问题是我不能让它们发生碰撞。请帮我。给我一些代码......
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您想要“让”刚体碰撞还是检测碰撞?
假设后者主要是目标,碰撞检测是一个非常广泛的主题,在不知道您面临的问题到底是什么的情况下很难给出准确的答案,并且由于您正在学习,我将提供一些链接应该有助于理解和实现 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:
Physics
Forums
tutorial
reference
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.