简体   繁体   English

UFPS +现代遗迹=玩家穿过墙

[英]UFPS + Modern Ruins = Player is passing through wall

first of all, i'm new to the world of Unity Game Development but i do have an established experience in working with C#. 首先,我是Unity游戏开发领域的新手,但是我确实在使用C#方面拥有丰富的经验。 I'm working with UFPS out-of-the-box using Modern Ruins ' Demo Scene as the primary map. 我正在使用UFPS开箱即用,将Modern Ruins的Demo Scene作为主要地图。 And for some reason, the default player (HeroHDWeapons) is passing through each and every objects on the map: walls, posts, literally everything. 由于某种原因,默认播放器(HeroHDWeapons)正在穿过地图上的每个对象:墙壁,柱子以及几乎所有东西。

However, i also have a humanoid asset for use on my AI/BOT using Low Poly Soldiers , also out-of-the-box, and i just added a Capsule Collider, yet he doesn't pass through wall - or maybe since he's using a Nav Mesh Agent for his movement. 但是,我也有一个人形化的资产,可以使用Low Poly Soldiers在我的AI / BOT上使用,也是开箱即用的,我只是添加了一个Capsule Collider,但他没有穿过墙-也许因为使用Nav Mesh Agent进行运动。

I've tried everything i know for my Player model based on what i've learned from basic unity tutorials. 我已根据从基本的统一性教程中学到的知识,尝试了对播放器模型所了解的一切。 I added a RigidBody Component, which makes my player fall off the map with the "Use Gravity" option ticked but regardless, still passes through walls. 我添加了一个RigidBody组件,使我的播放器从地图上掉下来,勾选了“使用重力”选项,但是无论如何,它仍然会穿过墙壁。 I also tried adding a Capsule Collider, still passes through. 我还尝试添加Capsule Collider,但仍然可以通过。

I did try adding a Capsule Collider on one of the objects on the map, and the player suddenly stopped passing through it. 我确实尝试过在地图上的一个对象上添加一个Capsule Collider,而玩家突然停止通过它。 Of course, adding a Collider Component on each and every object on the map is not a good idea - considering there are multiple hundreds of them. 当然,在地图上的每个对象上添加Collider Component并不是一个好主意-考虑到其中有数百个。

Here is the player model's properties: 这是播放器模型的属性: 在此处输入图片说明

PS: i've already done my fair share of research but none of them works. PS:我已经做了相当多的研究,但没有一个起作用。 except for those talking about using other syntax like Rigidbody.MovePosition(Vector3) as i don't know what it would impact on the entire UFPS Framework. 除了那些谈论使用Rigidbody.MovePosition(Vector3)类的其他语法的人之外,因为我不知道它将对整个UFPS Framework产生什么影响。

You need Colliders. 您需要碰撞器。 Simple as that. 就那么简单。 pick and choose what objects to collide if it makes it easier. 选择并选择要碰撞的对象(如果更容易)。 note that the unity Engine can ONLY handle 65536 different colliders at a time, only. 请注意,统一引擎一次只能处理65536个不同的对撞机。 lol. 大声笑。

According to the Unity3D documentation: 根据Unity3D文档:

"Note that the PhysX engine used by Unity only handles a maximum of 65536 colliders in a scene." “请注意,Unity使用的PhysX引擎最多只能处理一个场景中的65536个对撞机。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM