【发布时间】:2020-05-26 09:47:45
【问题描述】:
在 Unreal Engine 4 中,我有两个不同的类(Player 和 Enemy),它们生成相同类型的 Actor(Shot)。在新创建的镜头中,我如何找出这两个类中的哪一个产生了它?
我确信有一个非常简单的答案,但我在搜索时似乎无法正确表达它,因为我没有得到任何有用的点击。
注意:我最近才开始深入研究 UE4,所以很可能我已经找到了答案,但我不确定我在寻找什么。或者我应该简单地有两个不同的类(玩家射击和敌人射击)。任何帮助表示赞赏!
编辑:GetInstigator() 得到了我预期的值,但描述给我的印象不一定是我要找的:The APawn that is responsible for damage done by the spawned Actor. (Can be left as NULL).
【问题讨论】:
-
你可能想使用
AActor::Instigator/** Pawn responsible for damage and other gameplay events caused by this actor. */。 -
干杯,这似乎就是我一直在寻找的东西:D
标签: unreal-engine4 unreal-blueprint