当前位置:网站首页>UE4 通过互动(键盘按键)开门
UE4 通过互动(键盘按键)开门
2022-08-05 03:29:00 【Zhichao_97】
在上一篇博客中(UE4 通过重叠事件开启门)已经实现了靠近门门自动打开的效果,本篇博客要实现的效果是:玩家操控的角色靠近门时,门会显示提示文本,玩家根据提示的信息按下键盘相应的键时,门会打开和关闭。
效果:

步骤:
1.复制一份BPC_Door_OverLap,命名为BPC_Door_Interact,BPC_Door_OverLap的蓝图内容可以参考上一篇博客

2.打开设置-》项目设置

3.添加一个操作映射,表示按下键盘E时触发Interact

4.打开BPC_Door_Interact,添加如下节点

5.添加启用输入和禁用输入节点

6.添加获取玩家控制器,删除开门、关门节点

7.添加Flip Flop节点,表示第一次输入时执行A,第二次执行B,第三次执行A....

8.添加开门关门节点

9.添加两个文本渲染组件放在门的两侧,文本的值设为“E”

在细节面板中勾选游戏中隐藏,表示默认文字是隐藏的

10.将文本渲染组件拖入,从而获取对文本渲染组件的引用

11.添加如下节点,当启用输入时文本渲染组件不隐藏,禁用输入时隐藏

边栏推荐
- Solana NFT开发指南
- Detailed and comprehensive postman interface testing practical tutorial
- Based on holding YOLOv5 custom implementation of FacePose YOLO structure interpretation, YOLO data format conversion, YOLO process modification"
- Swing有几种常用的事件处理方式?如何监听事件?
- YYGH-13-客服中心
- AI+PROTAC | dx/tx completes $5 million seed round
- presto启动成功后出现2022-08-04T17:50:58.296+0800 ERROR Announcer-3 io.airlift.discovery.client.Announcer
- Package zip is not available, but is referred to by another package.
- This year's Qixi Festival, "love vegetables" are more loving than gifts
- Spark基础【介绍、入门WordCount案例】
猜你喜欢

This year's Qixi Festival, "love vegetables" are more loving than gifts

Is your data safe in this hyperconnected world?

Why did they choose to fall in love with AI?

markdown如何换行——md文件

.NET Application -- Helloworld (C#)

Leading the highland of digital medicine, Zhongshan Hospital explores to create a "new paradigm" for future hospitals
![[Software testing] unittest framework for automated testing](/img/80/caedd5cf6dd61c9d75475866613cac.png)
[Software testing] unittest framework for automated testing

iMedicalLIS监听程序(2)

Step by step how to perform data risk assessment

Ice Scorpion V4.0 attack, security dog products can be fully detected
随机推荐
The pit of std::string::find return value
大像素全景制作完成后,推广方式有哪些?
Burp installation and proxy settings
阿里本地生活单季营收106亿,大文娱营收72亿,菜鸟营收121亿
ffmpeg -sources分析
Use @Mapper to query the partition status of oracle and report an error
ASP.NET application--Hello World
用Unity发布APP到Hololens2无坑教程
Detailed and comprehensive postman interface testing practical tutorial
告白数字化转型时代,时速云镌刻价值新起点
大佬们,我注意到mysql cdc connector有参数scan.incremental.sna
通过模拟Vite一起深入其工作原理
rpc-remote procedure call demo
Growth-based checkerboard corner detection method
Native js realizes the effect of selecting and canceling all the multi-select boxes
Developing Hololens encountered The type or namespace name 'HandMeshVertex' could not be found..
Slapped in the face: there are so many testers in a certain department of byte
905. Interval selection
IJCAI2022 | DictBert: Pre-trained Language Models with Contrastive Learning for Dictionary Description Knowledge Augmentation
What is the difference between SAP ERP and ORACLE ERP?