Ue crashes every time i run game with GetActorLocation

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

just to add SetActorLocation(FVector(1,2,3)) works fine, something with GetActorLocation only

Ok I have no idea what’s going on but today I reopened project to try again, it tells me modules are missing for my project and to try and rebuild them.

After rebuilding it works fine.

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

Privacy & Terms