Script to scale a Static Mesh isn't working!

Hello!

can someone help me with this bug?. Im using this script to scale in real-time a random Static mesh actor. The script seems be working, but when i push the stop button i get a crash message. Thank you in advanced!

Seems to be working fine for me.

// Sets default values
AMyActor::AMyActor()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	Mesh = CreateDefaultSubobject<UStaticMeshComponent>("Mesh");
	RootComponent = Mesh;

	Scale = GetActorScale3D();
}

// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AMyActor::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	Scale += FVector(DeltaTime * 0.2f);

	SetActorScale3D(Scale);
}

This is an on going issue with 4.25. I am not sure what causes it but I see a lot of people talking about 4.25 crashing way too much and prefer to use 2.24.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms