Download

Crash with multiplayer PIE

Hey everyone,

So I’ve been having this issue with my game where when I load two separate windows of my game, when I try to execute a function called GrabArrow() on the client, UE4 crashes completely, even when GrabArrow() didn’t do anything at all. Other functions like moving, looking around and jumping seem to work so I’m not entirely sure what’s going on. Can someone help me out please?

BaseCharacter.cpp


void ABaseCharacter::GrabArrow()
 {
     AMyProjectGameMode* gamemode = (AMyProjectGameMode*)GetWorld()->GetAuthGameMode();
     AArrow* arrow_actor = gamemode->Arrow;
     ArrowStorage = arrow_actor;
     ArrowStorage->SetActorHiddenInGame(true);
     GetWorld()->GetTimerManager().SetTimer(HoldTimerHandle, this, &ABaseCharacter::FireArrow, HoldTime, false);
 
     bool overlap = GrabHitbox->IsOverlappingActor(arrow_actor);
 
     // If the hitbox is overlapping the arrow and the player hasn't already grabbed the arrow
     if (overlap && arrow_actor->PreviousHolder != this)
     {
         // DEBUG
         GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("Good"));
         ArrowStorage = arrow_actor;
         ArrowStorage->SetActorHiddenInGame(true);
         GetWorld()->GetTimerManager().SetTimer(HoldTimerHandle, this, &ABaseCharacter::FireArrow, HoldTime, false);
     }
 
 }

ABaseCharacter.h


 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "Arrow.h"
 
 #include "GameFramework/Character.h"
 #include "BaseCharacter.generated.h"
 
 UCLASS()
 class MYPROJECT_API ABaseCharacter : public ACharacter
 {
     GENERATED_BODY()
 
 
 public:
     // Sets default values for this character's properties
     ABaseCharacter();
 
     UFUNCTION()
         void MoveForward(float Value);
 
     UFUNCTION()
         void MoveRight(float Value);
 
     UFUNCTION()
         void Jump();
 
     UFUNCTION()
         void StopJumping();
 
     UFUNCTION()
         void LookUp(float Value);
 
     UFUNCTION()
         void LookRight(float Value);
 
     UFUNCTION()
         void DoubleJump();
 
     UFUNCTION()
         void Sprint();
 //...
 
     UFUNCTION()
         void DummyFunc();
 
     UFUNCTION()
         void GrabArrow();
 
 //...
 
     
     
 };

Note: I did play around with some parameters so if something looks alarmingly off, then it’s probably because I just wiped out the field and forgot to replace something. If you guys need some more of my code, I can provide!

EDIT: Here’s the error that UE4 gave me after the crash


MachineId:8BB607F948A2ED14E3E80E97D944BAD0
EpicAccountId:0d333b54115f47d3b56f115ecb7bc7d5

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

UE4Editor_MyProject_1909!ABaseCharacter::GrabArrow() [d:\personal files\documents\unreal projects\projectartemis\source\myproject\basecharacter.cpp:307]
UE4Editor_Engine!FInputActionUnifiedDelegate::Execute() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\classes\components\inputcomponent.h:181]
UE4Editor_Engine!UPlayerInput::ProcessInputStack() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\userinterface\playerinput.cpp:1216]
UE4Editor_Engine!APlayerController::ProcessPlayerInput() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:2313]
UE4Editor_Engine!APlayerController::TickPlayerInput() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:3851]
UE4Editor_Engine!APlayerController::PlayerTick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:1976]
UE4Editor_Engine!APlayerController::TickActor() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:3929]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\actor.cpp:111]
UE4Editor_Engine!FTickFunctionTask::DoTask() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private	icktaskmanager.cpp:262]
UE4Editor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\async	askgraphinterfaces.h:999]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\async	askgraph.cpp:932]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\async	askgraph.cpp:679]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\async	askgraph.cpp:1776]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private	icktaskmanager.cpp:530]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private	icktaskmanager.cpp:1432]
UE4Editor_Engine!UWorld::RunTickGroup() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:704]
UE4Editor_Engine!UWorld::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1197]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1349]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:368]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2775]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launch.cpp:148]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

I’m having this error right now, did you solve this problem?