Crash in 4.19

I dont get it, no matter what i do i keep getting the same error…nothing in VS, but this in UE crash report (git at bottom)

LoginId:04fd7c6a48b9533f23c2038677196ef7
EpicAccountId:a384bea0cc3d40bfbab9b2690e83468f

Access violation - code c0000005 (first/second chance not available)

UE4Editor_BattleTank!UTankAimingComponent::AimAt() [c:\users\mriml\documents\repos\battletanks\battletank\source\battletank\private\tankaimingcomponent.cpp:43]
UE4Editor_BattleTank!ATank::AimAt() [c:\users\mriml\documents\repos\battletanks\battletank\source\battletank\private\tank.cpp:47]
UE4Editor_BattleTank!ATankPlayerController::AimTowardsCrosshair() [c:\users\mriml\documents\repos\battletanks\battletank\source\battletank\private\tankplayercontroller.cpp:46]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

Solved, I needed to add an if statement to the AimTo() section, i also had the wrong Set BP chosen

What kind of if statement? Please im so confused and can’t continue the course because of this same problem

void UTankAimingComponent::AimAt(FVector HitLocation)
 {
	if (Barrel){
	auto OurTankName = GetOwner()->GetName();
 	auto BarrelLocation = Barrel->GetComponentLocation().ToString();
	UE_LOG(LogTemp, Warning, TEXT("%s aiming at %s from %s"), *GetOwner()->GetName(), *HitLocation.ToString(), *BarrelLocation);
	UE_LOG(LogTemp, Warning, TEXT("%s aiming at %s from %s"), *OurTankName, *HitLocation.ToString(), *BarrelLocation);
	}
 }

Also go through your BP make sure that the Projectile BP is selected on, i think Tank

1 Like

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

Privacy & Terms