【问题标题】:Unreal Engine 4: Spawn Emitter At Location虚幻引擎 4:在位置生成发射器
【发布时间】:2018-09-12 05:08:37
【问题描述】:

我在虚幻引擎 4.17.2 中使用了第一人称模板,并选择使用 C++ 而不是蓝图。我的目标是使从模板中的枪中射出的射弹在与被射出后接触的任何物体接触时爆炸。我计划在初始内容中使用爆炸粒子。为此,我打开了模板中的 projectile 类,并在 Visual Studio 2017 中编辑了头文件和源文件的代码。Here you can see I where I establish a particle system in the header file.

虽然在源文件中我在尝试使用 UGameplayStatics::SpawnEmitterAtLocation 时遇到问题

This is after using #include "Kismet/GameplayStatics.h"

【问题讨论】:

    标签: visual-c++ visual-studio-2017 unreal-engine4


    【解决方案1】:

    对于任何发现这一点的人,我在生成我的粒子系统时遇到了麻烦,尽管一切都在编译没有问题,并且相同的功能完全符合我在蓝图中的要求。 事实证明你两者都需要

    #include "Runtime/Engine/Classes/Kismet/GameplayStatics.h"
    #include "Runtime/Engine/Classes/Kismet/KismetSystemLibrary.h"
    

    能够在 C++ 中使用UGameplayStatics::SpawnEmitterAtLocation

    【讨论】:

    • 别在意我的上一篇文章,发生在我身上的是其他事情,显然 Overlap 事件没有填充 hitResult 结构,所以我在 FVector(0,0,0 )。如果任何人需要精确的切割伤害效果,他们可以从底部到剑尖做一条线跟踪,就像这个建议:answers.unrealengine.com/questions/741853/…
    猜你喜欢
    • 2016-02-07
    • 2020-07-15
    • 1970-01-01
    • 2015-09-24
    • 2018-11-19
    • 2020-07-24
    • 2015-02-04
    • 1970-01-01
    • 2016-11-30
    相关资源
    最近更新 更多