要让Actor使用gameplay ability system,则需要为其添加gameplay ability system component。我们需要通过C++创建具有这个componet的类,然后通过继承创建蓝图类。

为Actor添加Gameplay Ability System Componet
1、需要继承IAbilitySystemInterface
接口,并实现GetAbilitySystemComponent
方法。



2、添加UAbilitySystemComponent*
变量,并在构造函数中创建实例。


绑定用户输入到Ability(已经调用过GiveAbility了)
方法一:在SetupPlayerInputComponent
中调用AbilitySystemComponet->BindAbilityActivationToInputComponent()
方法。这个方法在ActionRPG中没使用,的确这个方法有点僵硬。具体可以参考:
https://wiki.unrealengine.com/GameplayAbilities_and_You#Notable_Variables
方法二:直接在蓝图中绑定

方法三:利用GameplayEvent, ActionRPG应该是利用这种方式,还没研究。
网友评论