Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDOing AttributeSet in constructor results in garbage collection #117

Open
rubenmoor opened this issue Aug 6, 2023 · 0 comments
Open

CDOing AttributeSet in constructor results in garbage collection #117

rubenmoor opened this issue Aug 6, 2023 · 0 comments

Comments

@rubenmoor
Copy link

https://forums.unrealengine.com/t/duplicating-an-actor-with-an-attributeset-fails/452327/2

This is a post describing the problem and the solution.

In my case, I CDOed the attribute set as described in the documentation and once I added a fifth attribute, the attribute set was nullptr after BeginPlay. Moving the initialization to PreInitializeComponents solved it:

void AMyPawn::PreInitializeComponents()
{
	Super::PreInitializeComponents();
	AttrSetAcceleration = NewObject<UAttrSetAcceleration>(this, "AttrSetAcceleration");
}
```cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant