当前位置:网站首页>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.添加如下节点,当启用输入时文本渲染组件不隐藏,禁用输入时隐藏

边栏推荐
- [TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction
- ffmpeg 枚举decoders, encoders 分析
- YYGH-13-Customer Service Center
- Never put off till tomorrow what you can put - house lease management system based on the SSM
- Spark基础【介绍、入门WordCount案例】
- Package zip is not available, but is referred to by another package.
- Intersection of Boolean Operations in SuperMap iDesktop.Net - Repairing Complex Models with Topological Errors
- Swing有几种常用的事件处理方式?如何监听事件?
- Solana NFT开发指南
- Linux下常见的开源数据库,你知道几个?
猜你喜欢

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

Details such as compiling pretreatment

Use Unity to publish APP to Hololens2 without pit tutorial

Ice Scorpion V4.0 attack, security dog products can be fully detected

测试薪资这么高?刚毕业就20K

七夕节代码表白

告白数字化转型时代,时速云镌刻价值新起点

Solana NFT开发指南

今年七夕,「情蔬」比礼物更有爱

The usage of try...catch and finally in js
随机推荐
Redis1:Redis介绍、Redis基本特性、关系型数据库、非关系型数据库、数据库发展阶段
阿里本地生活单季营收106亿,大文娱营收72亿,菜鸟营收121亿
沃谈小知识 |“远程透传”那点事儿
论治理与创新,2022 开放原子全球开源峰会 OpenAnolis 分论坛圆满落幕
通过模拟Vite一起深入其工作原理
Walter talked little knowledge | "remote passthrough" that something
ffmpeg pixel format basics
XMjs cross-domain problem solving
From "useable" to "easy to use", domestic software is self-controllable and continues to advance
Burp installation and proxy settings
21 Days Learning Challenge (2) Use of Graphical Device Trees
Dive into how it works together by simulating Vite
YYGH-13-客服中心
结构体初解
You may use special comments to disable some warnings. Three ways to report errors
Android Practical Development - Kotlin Tutorial (Introduction - Login Function Implementation 3.3)
如何在WordPress中添加特定类别的小工具
达梦8数据库导出导入
Dynamic management of massive service instances
ffmpeg 枚举decoders, encoders 分析