当前位置:网站首页>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.选中立方体,勾选生成重叠事件

边栏推荐
- Native js realizes the effect of selecting and canceling all the multi-select boxes
- Never put off till tomorrow what you can put - house lease management system based on the SSM
- You may use special comments to disable some warnings. 报错解决的三种方式
- Linux下常见的开源数据库,你知道几个?
- Principle and Technology of Virtual Memory
- 2022软件测试工程师最全面试题
- Hard power or soft power, which is more important to testers?
- Redis key基本命令
- 静态方法获取配置文件数据
- 七夕节代码表白
猜你喜欢

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

数据库设计的酸(ACID)碱(BASE)原则

沃谈小知识 |“远程透传”那点事儿
![[Paper Notes] MapReduce: Simplified Data Processing on Large Clusters](/img/89/8adef42b0cfd154e6fa7205afaeade.png)
[Paper Notes] MapReduce: Simplified Data Processing on Large Clusters

Is your data safe in this hyperconnected world?

2022 High-level installation, maintenance, and removal of exam questions mock exam question bank and online mock exam

运维监控系统之Open-Falcon

用CH341A烧录外挂Flash (W25Q16JV)

Details such as compiling pretreatment

毕设-基于SSM房屋租赁管理系统
随机推荐
You may use special comments to disable some warnings. Three ways to report errors
21 Days Learning Challenge (2) Use of Graphical Device Trees
This year's Qixi Festival, "love vegetables" are more loving than gifts
Flink 1.15.1 Cluster Construction (StandaloneSession)
The sword refers to Offer--find the repeated numbers in the array (three solutions)
public static <T> List<T> asList(T... a) 原型是怎么回事?
论治理与创新,2022 开放原子全球开源峰会 OpenAnolis 分论坛圆满落幕
MRTK3 develops Hololens application - gesture drag, rotate, zoom object implementation
2022.8.4-----leetcode.1403
Details such as compiling pretreatment
毕设-基于SSM房屋租赁管理系统
Swing有几种常用的事件处理方式?如何监听事件?
2022软件测试工程师最全面试题
Turn: Charles Handy: Who you are is more important than what you do
Intersection of Boolean Operations in SuperMap iDesktop.Net - Repairing Complex Models with Topological Errors
STM32 uses stm32cubemx LL library series tutorial
【滤波跟踪】基于matlab无迹卡尔曼滤波惯性导航+DVL组合导航【含Matlab源码 2019期】
YYGH-13-客服中心
leetcode-每日一题1403. 非递增顺序的最小子序列(贪心)
从“能用”到“好用” 国产软件自主可控持续推进