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

边栏推荐
- Detailed and comprehensive postman interface testing practical tutorial
- STM32 uses stm32cubemx LL library series tutorial
- iMedicalLIS监听程序(2)
- Use SuperMap iDesktopX data migration tool to migrate ArcGIS data
- Distributed systems revisited: there will never be a perfect consistency scheme...
- Slapped in the face: there are so many testers in a certain department of byte
- Defect detection (image processing part)
- rpc-remote procedure call demo
- presto启动成功后出现2022-08-04T17:50:58.296+0800 ERROR Announcer-3 io.airlift.discovery.client.Announcer
- 引领数字医学高地,中山医院探索打造未来医院“新范式”
猜你喜欢

presto启动成功后出现2022-08-04T17:50:58.296+0800 ERROR Announcer-3 io.airlift.discovery.client.Announcer

MRTK3开发Hololens应用-手势拖拽、旋转 、缩放物体实现

Industry Status?Why do Internet companies prefer to spend 20k to recruit people rather than raise their salary to retain old employees~

Spark基础【介绍、入门WordCount案例】

Details such as compiling pretreatment

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

用CH341A烧录外挂Flash (W25Q16JV)

How to sort multiple fields and multiple values in sql statement

Beyond YOLO5-Face | YOLO-FaceV2 officially open source Trick+ academic point full

静态方法获取配置文件数据
随机推荐
STM32 uses stm32cubemx LL library series tutorial
Step by step how to perform data risk assessment
新人如何入门和学习软件测试?
Confessing the era of digital transformation, Speed Cloud engraves a new starting point for value
The most effective seven performance testing techniques of software testing techniques
2022.8.4-----leetcode.1403
Web3.0 Dapps——通往未来金融世界的道路
达梦8数据库导出导入
YYGH-13-客服中心
Android实战开发-Kotlin教程(入门篇-登录功能实现 3.3)
Cybersecurity and the Metaverse: Identifying Weak Links
Android Practical Development - Kotlin Tutorial (Introduction - Login Function Implementation 3.3)
How to simulate the background API call scene, very detailed!
AI+PROTAC | dx/tx completes $5 million seed round
Principle and Technology of Virtual Memory
【滤波跟踪】基于matlab无迹卡尔曼滤波惯性导航+DVL组合导航【含Matlab源码 2019期】
2022-08-04 第六小组 瞒春 学习笔记
The pit of std::string::find return value
.NET应用程序--Helloworld(C#)
21 Days Learning Challenge (2) Use of Graphical Device Trees