How should I get the player controller inside ActivateAbility in an ability?
Jump to turn (7)
- 1How should I get the player controller inside ActivateAbility in an ability?
- 2Is it okay to get the player controller in ability or is there a better way to d
- 3How can I create the targeting actor in the player controller but also access th
- 4How do I use TSharedPtr inside an ability class in ue5 gas?
- 5I am trying to create my targeting widget inside my player controller like so Ta
- 6Is this the best absolute way of doing things?
- 7How do I should wait for the StartTargeting method to be finished before doing s
- User
How should I get the player controller inside ActivateAbility in an ability?
- Assistant
To get the player controller inside the ActivateAbility function in a UE4 (Unreal Engine 4) ability, you can use the following method:
- Include the headers for the Ability System Component and the Player Controller at the top of your .cpp file:
cpp#include "AbilitySystemComponent.h" #include "GameFramework/PlayerController.h"- Inside the ActivateAbility function, get a reference to the Ability System Component and the owning Actor:
cpp