Access violation - code c0000005

That error code generally means that something’s trying to access an object/memory address that isn’t there anymore.

Are you checking your pointers for null before accessing their properties?
e.g.

APlayerController* pc;

// do some stuff

if( pc != nullptr)
{
     pc->SomeFunction();
     //Do some  other stuff
}

Also, if you have any class variables derived from UActor, ensure that you are decorating them correctly with UPROPERTY() e.g.

UPROPERTY()
APlayerCharacter* PlayerCharacter;

Otherwise these objects will get garbage collected and you’ll run into access violations.