When I compile below code in unreal it is successful. But when I run it crashes my unreal engine.
I narrowed it down to GetActorLocation line:
// Called every frame
void AMovingActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
//UE_LOG(LogTemp, Warning, TEXT("Hello World!"));
//SetActorLocation(my_location);
FVector cur_actor_loc = GetActorLocation();
//if (cur_actor_loc.Z < 50 || cur_actor_loc.Z > 500) {
// platform_movement_offset = platform_movement_offset * -1;
//}
//cur_actor_loc.Z = cur_actor_loc.Z + platform_movement_offset;
//SetActorLocation(cur_actor_loc);
}
What does this error even mean??
LoginId:08cbac094f5d51250b1563b7124ecf7d
EpicAccountId:5207bc2f9b5843bda7130874d27aad9b
Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 10] Cast of Object /Script/CoreUObject.Default__Object to Actor failed