当前位置:网站首页>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.选中立方体,勾选生成重叠事件
边栏推荐
- Kubernetes 网络入门
- Redis key基本命令
- 高项 02 信息系统项目管理基础
- Beyond YOLO5-Face | YOLO-FaceV2 officially open source Trick+ academic point full
- 【软件测试】自动化测试之unittest框架
- 2022软件测试工程师最全面试题
- ffmpeg 枚举decoders, encoders 分析
- Fifteen. Actual combat - MySQL database building table character set and collation
- rpc-remote procedure call demo
- CPDA|How Operators Learn Data Analysis (SQL) from Negative Foundations
猜你喜欢
【已解决】Unity Coroutinue 协程未有效执行的问题
leetcode-每日一题1403. 非递增顺序的最小子序列(贪心)
结构体初解
Detailed and comprehensive postman interface testing practical tutorial
开发Hololens遇到The type or namespace name ‘HandMeshVertex‘ could not be found..
为什么pca分量没有关联
public static <T> List<T> asList(T... a) 原型是怎么回事?
【软件测试】自动化测试之unittest框架
[TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction
Never put off till tomorrow what you can put - house lease management system based on the SSM
随机推荐
Details such as compiling pretreatment
Solana NFT开发指南
运维监控系统之Open-Falcon
Redis key基本命令
GC Gaode coordinate and Baidu coordinate conversion
Web3.0 Dapps - the road to the future financial world
用Unity发布APP到Hololens2无坑教程
leetcode-每日一题1403. 非递增顺序的最小子序列(贪心)
Package zip is not available, but is referred to by another package.
结构体初解
The most effective seven performance testing techniques of software testing techniques
MRTK3 develops Hololens application - gesture drag, rotate, zoom object implementation
The usage of try...catch and finally in js
Never put off till tomorrow what you can put - house lease management system based on the SSM
新人如何入门和学习软件测试?
Flink 1.15.1 Cluster Construction (StandaloneSession)
惨遭打脸:字节某部门竟有这么多测试员
How to find all fields with empty data in sql
十五. 实战——mysql建库建表 字符集 和 排序规则
2022 High-level installation, maintenance, and removal of exam questions mock exam question bank and online mock exam