You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do we call BeginSpawningActor(), and FinishSpawningActor()? They require an AActor* for FinishSpawningActor, and BeginSpawningActor requires an AActor*&? Also, UAbilityTask_SpawnActor::SpawnActor() also requires a reference to the class, but not location, but beginspawning requires location. This whole function is bizarre to call in C++. Any tips?
The text was updated successfully, but these errors were encountered:
Note that this issues section is for issues specific to the GASDocumentation repo, not for general unreal dev issues or general c++ issues.
What you're looking at is a common c++ technique. Do a search for "c++ pass by value vs by reference" and "c++ pointers" for resources on this issue.
TL;DR: You're passing a AActor pointer by reference to BeginSpawningActor(). Begin SpawningActor() sets the value of that pointer to the AActor it just spawned. You can then do whatever you want with it before calling FinishSpawningActor(). Or, if you don't need to do anything special with it between spawn time and blueprint construction script, you can just call SpawnActor() in one go.
How do we call BeginSpawningActor(), and FinishSpawningActor()? They require an AActor* for FinishSpawningActor, and BeginSpawningActor requires an AActor*&? Also, UAbilityTask_SpawnActor::SpawnActor() also requires a reference to the class, but not location, but beginspawning requires location. This whole function is bizarre to call in C++. Any tips?
The text was updated successfully, but these errors were encountered: