Hello everyone,
I have an actor which creates a dynamic object inside of its BeginPlay function. I want to delete (free) this variable inside of EndPlay function. How can I free that memory?
Example code:
void AWeapon::BeginPlay()
{
Super::BeginPlay();
// Create a new object
Curve = NewObject<UCurveVector>(this);
}
void AWeapon::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Super::EndPlay(EndPlayReason);
// How to free the variable 'Curve' in here?
}