简体   繁体   English

是否可以在 Ursina Engine 中创建一个无形的屏障?

[英]Is it possible to create an invisible barrier in Ursina Engine?

Does Ursina allow for one to create an invisible barrier to prevent the player from falling off the map, if so, how could I do that, if not should I just add walls to prevent that from happening? Ursina 是否允许一个人创建一个无形的屏障来防止玩家从地图上掉下来,如果是这样,我该怎么做,如果不是,我应该只添加墙来防止这种情况发生吗?

Yes, it is possible.是的,有可能。 You can create an entity and make it visible = False or just make it transparent (less optimized) color = color.rgba(0,0,0,0)您可以创建一个实体并使其visible = False或仅使其透明(优化程度较低) color = color.rgba(0,0,0,0)

Here is an example:这是一个例子:

barrier = Entity(model='cube', collider='box', visible=False)

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

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