6.添加视觉效果

在这步中需要添加一个粒子系统、声效、辐射力,并在手枪爆炸后进行清理。

步骤

  1. 使用在之前部分中学习到的技巧创建一个 Add Radial Force Component 节点。

    image alt text

  2. 它需要一个变形,因此要创建一个 Make Transform 节点并将其连接到 Add Radial Force Component 上的 Relative Transform 引脚。

    image alt text

  3. 选择 Add Radial Force Component 并将 Impulse Strength 改为 650.0。启用 Impulse Vel Change,启用 Ignore Owning Actor,并将 Force Strength 设为 0.0

    image alt text

  4. 此外,使用 Object Types to Affect 上的 + 符号添加一个新条目并将其改为 WorldDynamic。此设置将使力击中机器人布偶。

    image alt text

  5. 接下来从 Add Radial Force Component 上的 Return Value 连出引线,搜索并创建一个 Fire Impulse 节点。

    image alt text

  6. 从此节点的输出执行引脚添加一个 Spawn Emitter at Location 节点。

    image alt text

  7. 将其 Emitter Template 设为 Boss_Rocket_Explo

    image alt text

  8. 从此节点的输出执行引脚添加一个 Spawn Sound at Location 节点。

  9. 将其 Sound 设为 GrendaeExplosion_C_Cue

    image alt text

  10. 从此节点的输出执行引脚添加一个 Set Ammo Remaining 节点,其值设为 0。

  11. 从此节点的输出执行引脚添加一个 Force Cleanup 节点。此节点负责溶解并销毁手枪。

    image alt text

  12. 创建一个 Self 节点(搜索 Get a reference to self)。从 Return Value 连出引线并创建一个 Get Actor Location 节点。

    image alt text

  13. Get Actor Location 节点的输出连接到 Spawn EmitterSpawn Sound at Location 节点。

    image alt text

  14. 以下可看到完整图表。

    下方图表已使用 re-route 节点 进行清理。这种节点实际上是传递节点,可更好地组织图表中的连接,使图表更易读。

    Copy Node Graph

    点击此图左上角的图标复制蓝图图表并将其粘贴到项目中。

结果

GrenadeGunPistol 现已完成。下一步中我们将了解如何对枪进行测试,以及如何进行更进一步的设置。