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

边栏推荐
- Burp installation and proxy settings
- 高项 02 信息系统项目管理基础
- public static <T> List<T> asList(T... a) 原型是怎么回事?
- 数据库设计的酸(ACID)碱(BASE)原则
- 905. Interval selection
- cross domain solution
- Turn: Charles Handy: Who you are is more important than what you do
- 2022 Hangzhou Electric Multi-School 1st Game
- [Software testing] unittest framework for automated testing
- The pit of std::string::find return value
猜你喜欢

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

The most effective seven performance testing techniques of software testing techniques

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

Increasing leetcode - a daily topic 1403. The order of the boy sequence (greed)

为什么pca分量没有关联

Swing有几种常用的事件处理方式?如何监听事件?

大像素全景制作完成后,推广方式有哪些?

Flink 1.15.1 Cluster Construction (StandaloneSession)

【 genius_platform software platform development 】 : seventy-six vs the preprocessor definitions written cow force!!!!!!!!!!(in the other groups conding personnel told so cow force configuration to can

2022-08-04 The sixth group, hidden from spring, study notes
随机推荐
[Solved] Unity Coroutine coroutine is not executed effectively
AI+PROTAC | dx/tx completes $5 million seed round
markdown如何换行——md文件
Mathematics - Properties of Summation Symbols
开发Hololens遇到The type or namespace name ‘HandMeshVertex‘ could not be found..
银行数据采集,数据补录与指标管理3大问题如何解决?
This year's Qixi Festival, "love vegetables" are more loving than gifts
剑指Offer--找出数组中重复的数字(三种解法)
Shell script: for loop and the while loop
冰蝎V4.0攻击来袭,安全狗产品可全面检测
通过模拟Vite一起深入其工作原理
阿里本地生活单季营收106亿,大文娱营收72亿,菜鸟营收121亿
数据库设计的酸(ACID)碱(BASE)原则
Redis key基本命令
How to discover a valuable GameFi?
10 years of testing experience, worthless in the face of the biological age of 35
ffmpeg enumeration decoders, encoders analysis
MRTK3开发Hololens应用-手势拖拽、旋转 、缩放物体实现
public static <T> List<T> asList(T... a) 原型是怎么回事?
【Mysql进阶优化篇02】索引失效的10种情况及原理