Unreal Engine 4:学习笔记(十六)Flow Control & Timeline

本文详细介绍了UE4中Blueprint的流程控制节点,包括可编辑Switch、Branch、DoN、DoOnce、FlipFlop、ForLoop、ForLoopWithBreak、Gate、MultiGate、Sequence、WhileLoop等节点的功能及使用方法,并深入解析了Timeline节点的工作原理,如Play、PlayFromStart、Stop、Reverse、ReverseFromEnd、SetNewTime等操作及其与函数、向量、事件轨迹的结合。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Blueprint的流程控制节点主要包括如下几种:

节点描述
Editing Switch可编辑Switch节点,可以自定义分枝的值,分枝的值支持int,string,name三种类型
Branch相当于if
DoN可以设置执行次数,如果已执行过指定次数,可以使用Reset重置,重置后可以再执行执行指定次数
DoOnce仅执行一次,可以使用Reset重置,重置后可以再执行执行指定次数。若设置了start Closed表示最开始不可执行,必须调用过Reset才能再次执行。
FlipFlop当此节点被多次调起时,输出这次为A,下次为B,再下次为A,再下次为B,如此往复。
ForLoop通过First Index和Last Index指定循环次数,循环体被调起后,不等被调起的任务结束,就会开始下次循环,直到结束,中间不能中断。
ForLoopWithBreak与ForLoop相同,但中间可以中断循环。
GateOpen设置此节点可打开状态。Close设置此节点为关闭状态。Toggle若为打开状态则改为关闭状态,若为关闭状态则改为打开状态。
MultiGate可设置多个输出pin,当此节点被多次调用时,第一次输出第0个pin,第二次输出第1个pin,如此类推。若设置了Loop,则可以反复调用。若调用了Reset,则重新从第0个pin开始输出。若设置了is random,则输出pin的顺序随机。
Sequence按照输出pin的顺序依次调用其连接的节点,但并不等待其连接的节点执行结束。
WhileLoop满足一定条件的循环。

Timeline:

用于在一段时间内多次调起与之相连的节点,调起的时间间隔由ue4系统决定。可以设置Loop来决定是否重复执行。可以设置AutoPlay来决定是否此节点自动调起。

输入类型描述
Playexec从New Time设置的位置开始执行,此时Set New Time要先被调用
Play From Startexec从开始位置执行
Stopexec停止执行
Reverseexec从New Time设置的位置向反方向开始执行,此时Set New Time要先被调用
Reverse From Endexec从终止位置反方向开始执行
Set New Timeexec只Set New Time先被调用,New Time才有效
New Timedata对于Play是设置正方向开始位置,对于Reverse是设置反方向开始位置
输出类型描述
Updateexec连接被执行节点,调起的时间间隔由ue4系统决定
Finishedexec若Timeline结束,则调用与此输出连接的节点
Directiondata若是正方向执行则返回Forward,若是反方向执行则返回Backward

另外,可以对Timeline设置三种轨迹:函数、向量和事件
函数:是连续的线。Timeline节点好会多出一个data类型的输出
向量:也是连续的线,但有三条分别表示X、Y、Z。Timeline节点好会多出一个data类型的输出
事件:不连续的点。Timeline节点上会多出一个exec类型的输出

 

参考文档

Documentation Home -> Blueprints Visual Scripting -> Basic Scripting -> Flow Control
Documentation Home -> Blueprints Visual Scripting -> Timelines

Unreal Engine 4 for Beginners, as its name implies, is specifically written with the beginner in mind. It is meant for those who wish to learn how to make video games with no prior game development, game design, or game programming experience. It concentrates on the fundamentals, in order to build a rock solid foundation upon which the reader can use to confidently explore more intermediate and advanced topics. It provides a thorough examination of the basics, covering each subject in fine detail. Great care has been taken to ad vance through the subject matter in an order that best ensures that everything needed to understand one piece of information has already been covered in the information prior. It makes a great textbook for an Intro to Unreal Engine, or Unreal Engine 101 course. In addition, the book has been formatted specifically for ease of use with tablets and other mobile devices. The book concentrates heavily on four key areas: Environments - Construct beautiful environments with moving objects and sounds Inputs - Enter and explore the worlds you construct by creating a Character and specifying how it can move and how to control those movements Menus & Displays - Learn how to create the user interfaces and on-screen displays that will enhance your game and bring it to the next level Logic - Learn how to construct logic and take full control over the first three subject areas. How should objects in your world move? What should cause a certain sound to play? How does the player win the game? You decide! No need to wait for shipping! Get started learning the fundamentals of game development right now with this specially formatted ebook textbook! Table of Contents Chapter 1 Getting Started Chapter 2 Basic Concepts Chapter 3 The Level Editor Chapter 4 Actors Chapter 5 Blueprints Chapter 6 Players & Input Chapter 7 Collisions Chapter 8 User Interfaces Chapter 9 Audio Chapter 10 Additional Topics Book Details QR code for Unreal Engine 4 for Beginners Title: Unreal Engine 4 for Beginners 收缩
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值