当前位置:网站首页>UE4 通过与其它Actor互动开门
UE4 通过与其它Actor互动开门
2022-08-05 03:29:00 【Zhichao_97】
在上一篇博客中(UE4 通过重叠事件开启门)已经实现了通过重叠事件开关门的效果,这篇文章在此基础上,新建一个Actor(压力板),实现当有东西压在压力板上面时就会开门的效果。
效果:
可以看到当立方体压住压力板时,门会打开

步骤:
1.新建一个Actor

命名为BP_PressurePlate

2.打开BP_PressurePlate,添加一个静态网格体组件命名为压力板

赋予静态网格体形状并调整缩放
3.添加一个盒体碰撞组件并调整其大小

4.点击添加组件开始和结束重叠时的事件

5.如下图,可以看到没有开门的引用,原因是他们不在一个Actor中

因此需要先获得一个对门的引用
新建一个变量,命名为DoorReference

在细节面板中,变量类型选择 BP Door Parent-》对象引用

设置为可编辑实例

6.获取引用

7.创建如下节点,实现重叠开门

但是结束重叠不能只调关门,比如将一个盒体推到压力板上,玩家控制的角色也站在压力板上,此时角色离开,门还是会关闭,因此需要做一个检查
8.拖入盒体碰撞

9.连接到获取重叠Actor

选择类为Actor,此时获取重叠Actor节点的输出是一个数组,数组包括了当前所有重叠Actor。

10.创建如下节点,点击 编译

11.将BP_PressurePlate拖入到立方体旁边, 设置对门的引用

12.选中立方体,勾选生成重叠事件

边栏推荐
- [TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction
- Hard power or soft power, which is more important to testers?
- iMedicalLIS监听程序(2)
- 用CH341A烧录外挂Flash (W25Q16JV)
- ffmpeg -sources分析
- Growth-based checkerboard corner detection method
- 毕设-基于SSM房屋租赁管理系统
- Developing Hololens encountered The type or namespace name 'HandMeshVertex' could not be found..
- markdown如何换行——md文件
- 今年七夕,「情蔬」比礼物更有爱
猜你喜欢

【Mysql进阶优化篇02】索引失效的10种情况及原理

After the large pixel panorama is completed, what are the promotion methods?

2022 High-level installation, maintenance, and removal of exam questions mock exam question bank and online mock exam
![[Paper Notes] MapReduce: Simplified Data Processing on Large Clusters](/img/89/8adef42b0cfd154e6fa7205afaeade.png)
[Paper Notes] MapReduce: Simplified Data Processing on Large Clusters

今年七夕,「情蔬」比礼物更有爱

Bubble Sort and Quick Sort

论治理与创新,2022 开放原子全球开源峰会 OpenAnolis 分论坛圆满落幕

运维监控系统之Open-Falcon

How to discover a valuable GameFi?

基于生长的棋盘格角点检测方法
随机推荐
惨遭打脸:字节某部门竟有这么多测试员
Native js realizes the effect of selecting and canceling all the multi-select boxes
2022高处安装、维护、拆除考试题模拟考试题库及在线模拟考试
Mathematics - Properties of Summation Symbols
Growth-based checkerboard corner detection method
Fifteen. Actual combat - MySQL database building table character set and collation
Use CH341A to program external Flash (W25Q16JV)
通过模拟Vite一起深入其工作原理
Static method to get configuration file data
Talking about data security governance and privacy computing
You may use special comments to disable some warnings. 报错解决的三种方式
Bubble Sort and Quick Sort
Dive into how it works together by simulating Vite
Web3.0 Dapps - the road to the future financial world
Based on holding YOLOv5 custom implementation of FacePose YOLO structure interpretation, YOLO data format conversion, YOLO process modification"
shell脚本:for循环与while循环
2022 Hangzhou Electric Multi-School 1st Game
[TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction
ASP.NET应用程序--Hello World
High Item 02 Information System Project Management Fundamentals