当前位置:网站首页>UE4 通过按键控制物体的旋转
UE4 通过按键控制物体的旋转
2022-07-26 04:22:00 【Zhichao_97】
实现效果:

实现步骤:
1.在内容浏览器中,右键点击蓝图类,创建一个名为 物体自转_BP 的蓝图 ,双击打开

2.添加组件-》立方体

3.将Cube拖入

4.添加本地旋转,设置z的值为2

5.增加 事件Tick (表示每一帧都执行 本地旋转)

此时方块已经能自己转了

接下来就是要能够控制方块的旋转
6.创建一个分支
7.创建一个变量,命名为 是否可以旋转,设置变量的类型为布尔

8.按住ctrl将刚创建的变量拖入事件图表中(表示获得这个变量),并点击 编译

9.创建 自定义事件,来控制布尔值什么时候为True或False

10创建 flip flop ,表示按一次走A,再按一次走B,以此循环
11.将变量拖入事件图表中,选择设置是否可以旋转,

12.复制一份,如下图:

13.可以将flip flop换成分支来判断当前的布尔值是对的或错的

14.回到第三人称蓝图中,新增事件图表命名为控制方块旋转

15.创建 键盘 1;创建变量命名为自转物体引用,变量类型设置为 物体自转_BP->对象引用,这样就可以引用物体自转_BP这个蓝图中的变量等内容了

16.创建isValid

17.从自转物体引用中拉出连接线,选择创建 控制旋转,再连线

18.点击标注的小眼睛,再点击 编译
19.点击标注的吸管图标,再点击视口界面的 物体自转_BP (就是小人旁边的白色方块)

↓

边栏推荐
- MySQL日志分类:错误日志、二进制日志、查询日志、慢查询日志
- 远坂凛壁纸
- 支持代理直连Oracle数据库,JumpServer堡垒机v2.24.0发布
- MySQL - multi table query - Cartesian product sum, correct multi table query, equivalent connection and unequal connection, inner connection and outer connection
- Linear basis property function code to achieve 3000 words detailed explanation, with examples
- (translation) timing of website flow chart and user flow chart
- How is the launch of ros2 different?
- How engineers treat open source -- the heartfelt words of an old engineer
- 【SVN】一直出现 Please execute the ‘Cleanup‘ command,cleanup以后没有反应的解决办法
- egg-ts-sequelize-CLI
猜你喜欢

吴恩达机器学习课后习题——线性回归

理性认知教育机器人寓教于乐的辅助作用

当你尝试删除程序中所有烂代码时 | 每日趣闻

Huawei issued another global convening order of "genius youth", and some people once gave up their annual salary of 3.6 million to join

Share | 2022 big data white paper of digital security industry (PDF attached)

1. Excel的IF函数

Credit card fraud detection based on machine learning

Design and implementation of smart campus applet based on cloud development

MATLAB绘图

How to transfer English documents to Chinese?
随机推荐
Yadi started to slow down after high-end
Dynamic planning for stair climbing
egg-sequelize JS编写
Pathmatchingresourcepatternresolver parsing configuration file resource file
Day26 job
Life related - ten years of career experience (turn)
[project chapter - how to write and map the business model? (3000 word graphic summary suggestions)] project plan of innovation and entrepreneurship competition and application form of national Entrep
MapReduce中分区数与ReduceTask个数关系比较
TIA botu WinCC Pro controls the display and hiding of layers through scripts
How mantium uses deepspeed to implement low latency gpt-j reasoning on Amazon sagemaker
旋转数组最小数字
吴恩达机器学习课后习题——线性回归
Credit card fraud detection based on machine learning
Comprehensive evaluation and decision-making method
Leetcode:1184. Distance between bus stops -- simple
Huawei executives talk about the 35 year old crisis. How can programmers overcome the worry of age?
Scroll view pull-down refresh and pull-up load (bottom)
How to write the summary? (including 7 easily ignored precautions and a summary of common sentence patterns in 80% of review articles)
Dijango learning
1. If function of Excel