1.Actor和Component
在Unreal Engine中,Actor 和 Component 是构建游戏世界的两个基本概念,它们之间有一些重要区别:
- Actor(角色):
- Actor 是游戏世界中的实体,它可以被放置在场景中,并且可以是可见的或不可见的。
- 每个 Actor 都有一个 Transform(位置、旋转和缩放信息),它定义了 Actor 在游戏世界中的位置和方向。
- Actor 可以包含一个或多个 Component,它们定义了 Actor 的各种属性和功能An Actor is any object that can be placed into a level, such as a Camera, static mesh, or player start location. Actors support 3D transformations such as translation, rotation, and scaling. They can be created (spawned) and destroyed through gameplay code (C++ or Blueprints).(虚幻官方)
- Component(组件):
- Component 是 Actor 的组成部分,用于定义 Actor 的特定功能或行为。
- Component 可以包括网格、碰撞体、动画、物理属性等。
- 一个 Actor 可以包含多个不同类型的 Component,每个 Component 负责不同的功能。
- Component 本身不具备位置、旋转和缩放信息,都由它们所附加到的 Actor 来确定。Components are a special type of Object that Actors can attach to themselves as sub-objects. Components are useful for sharing common behaviors, such as the ability to display a visual representation, play sounds. They can also represent project-specific concepts, such as the way a vehicle interprets input and changes its own velocity and orientation. For example, a project with user-controllable cars, aircraft, and boats could implement the differences in vehicle control and movement by changing which Component a vehicle Actor uses.(虚幻官方)
因此,可以总结如下区别:
- Actor 是游戏世界中的实体(角色、道具、车辆、摄像机、灯光等等),而 Component 是 Actor 的组成部分(Mesh、灯光、音频、碰撞体、摄像机、粒子系统、UI 等等)。
- Actor 具有 Transform 信息,而 Component 没有,它们的位置和方向是由它们所附加到的 Actor 决定的。
- Actor 可以包含一个或多个 Component,每个 Component 负责不同的功能。
2.Array
Array(数组) 主要用于存储和处理游戏中的数据,如游戏对象、变量、状态等。作为一种灵活的数据结构,可以根据需要动态地增加或减少大小
Clear Array 节点 会将数组的长度缩减为零,移除数组中所有元素。以清空数组和释放内存。
标签:游戏,vehicle,Component,Actor,引擎,虚幻,such,Array From: https://blog.csdn.net/charon8778/article/details/140482840