Should we be using SetupAttachment() rather than AttachToComponent()?

From the documents of AttachToComponent():

“It is valid to call this on components whether or not they have been Registered, however from constructor or when not registered it is preferable to use SetupAttachment.”

From the documents of SetupAttachment():

“Generally intended to be called from its Owning Actor’s constructor and should be preferred over AttachToComponent when a component is not registered.”

I don’t know if it matters or not in our implementation, but from the documentation of the two functions it seems to suggest that we should be using SetupAttachment() as a best practice, because we’re attaching the components in the Owning Actor (Projectile)'s, constructor.

4 Likes

Privacy & Terms