FHitResult HitResult;
FVector StartPoint = ProjectileSpawnPoint->GetComponentLocation();
FVector EndPoint = StartPoint + ProjectileSpawnPoint->GetForwardVector()*FireRange;
bool LineTrace = GetWorld()->LineTraceSingleByChannel(HitResult, StartPoint, EndPoint, ECC_WorldDynamic);
DrawDebugLine(GetWorld(),StartPoint,EndPoint,FColor::Red,true,0.f,0.f,5.f);
if(LineTrace)
{
UE_LOG(LogTemp,Warning,TEXT("%s"),*(HitResult.GetActor()->GetName()));
}
if(Cast<ATank>(HitResult.GetActor())==Tank)
{
i used this code and after i compiled it played the game it was working(but not the linetracing logic) ,but suddenly the editor crashes then i removed this code and compiled it again it crashes again
i installed editor Symbols for debugging in unreal engine 5 now this is the whole callstack-
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff
UnrealEditor_CoreUObject!UStruct::IsChildOf() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:2202]
UnrealEditor_CoreUObject!StaticExit() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp:4750]
UnrealEditor_CoreUObject!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:731]
UnrealEditor!TMulticastDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::Broadcast() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:967]
UnrealEditor!FEngineLoop::AppPreExit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:6124]
UnrealEditor!FEngineLoop::Exit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4524]
UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:197]
UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
UnrealEditor!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll