-WaitMutex- error sufficient right needed to access the file

Hello, been receiving this type of error in my coding… may i know how to solve this error?

284916-help.png

This is the code i use for this error. Its a header file named KeyPickup “KeyPickup.h”

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "KeyPickup.generated.h"
#include "Components/BoxComponent.h"

UCLASS()
class MYPROJECT_API AKeyPickup : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AKeyPickup();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UPROPERTY(EditAnywhere)
		UStaticMeshComponent* PickupMesh;
	UPROPERTY(EditAnywhere)
		USceneComponent* PickupRoot;
	UPROPERTY(EditAnywhere)
		UBoxComponent* PickupBox;

	UFUNCTION()
		void onPlayerOverlapPickupBox(UPrimitiveComponent*overlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

};

PS : if you need more clarification about which files i need to show here… please do inform me… thanks

are you using your onPlayerOverlapPickupBox function in your .cpp?

otherwise, remove #include “Components/BoxComponent.h” from your .h and add it to your .cpp

coloque su funcion en su .cpp

Yes:

void AKeyPickup::onPlayerOverlapPickupBox(UPrimitiveComponent* overlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{

}

Hello tried doing that… still no fix and more errors occured

yes im using it later for my pickup items … just had trouble dealing with the above errors…

hello, this way if your code works:

.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "KeyPickup.generated.h"

UCLASS()
class POGOPAINTER_API AKeyPickup : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AKeyPickup();

	UPROPERTY(EditAnywhere)
		class UStaticMeshComponent* PickupMesh;

	UPROPERTY(EditAnywhere)
		class USceneComponent* PickupRoot;

	UPROPERTY(EditAnywhere)
		class UBoxComponent* PickupBox;

	UFUNCTION()
		void onPlayerOverlapPickupBox(UPrimitiveComponent* overlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

};

.cpp:

// Fill out your copyright notice in the Description page of Project Settings.


#include "KeyPickup.h"
#include "Components/StaticMeshComponent.h"
#include "Components/BoxComponent.h"

// Sets default values
AKeyPickup::AKeyPickup()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void AKeyPickup::BeginPlay()
{
	Super::BeginPlay();

}

// Called every frame
void AKeyPickup::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

void AKeyPickup::onPlayerOverlapPickupBox(UPrimitiveComponent* overlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{

}

Did you refresh your visual studio project?

for that you must close visual studio and go to File-> Refrest Visual Studio Project

I checked my code and if it works

i followed your code… looks like there’s a little less errors on this but still the main focus of the error does not subsides…
based on the declaration error, should I remove the BeginPlay() and Tick() function declaration in header file?

The error that came out in the registry is as if the changes I mentioned were not applied. Place everything as in the code I left at the top and compile. If you continue the problem try to create a new project and do the same procedure.

sadly the same error occured… already refreshed my visual studio

Solved this by creating a new project entirely… encounter another problem when tried adding my new code in it…

(since this is new project, i use different name file)
Pick.cpp
// Fill out your copyright notice in the Description page of Project Settings.

#include "Pick.h"
#include "Components/StaticMeshComponent.h"
#include "Components/BoxComponent.h"

// Sets default values
APick::APick()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	PickupRoot = CreateDefaultSubobject<USceneComponent>(TEXT("PickupRoot"));
	RootComponent = PickupRoot;
	PickupMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("PickupMesh"));
	PickupMesh->AttachToComponent(PickupRoot, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
	PickupBox = CreateDefaultSubobject<UBoxComponent>(TEXT("PickupBox"));
	//PickupBox->SetWorldScale3D(FVector(1.0f, 1.0f, 1.0f));
	PickupBox->bGenerateOverlapEvents = true;
	PickupBox->OnComponentBeginOverlap.AddDynamic(this, &APick::onPlayerOverlapPickupBox);
	PickupBox->AttachToComponent(PickupRoot, FAttachmentTransformRules::SnapToTargetNotIncludingScale);


}

// Called when the game starts or when spawned
void APick::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void APick::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

void APick::onPlayerOverlapPickupBox(UPrimitiveComponent* overlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
	Destroy();
}

A couple thoughts:

  1. In your pick.h header file my understanding is #include “pick.generated.h” call must be the last on the list

  2. You cannot access bGenerateOverlapEvents directly, it is private. You have to use the setter:

    PickupBox->SetGenerateOverlapEvents(true);

See: UPrimitiveComponent | Unreal Engine Documentation
(part of the problem may be that this api reference doesn’t show bGenerateEvents but if you look at the source code it is clear it is private):

private:
	UPROPERTY(EditAnywhere, BlueprintGetter = GetGenerateOverlapEvents, BlueprintSetter = SetGenerateOverlapEvents, Category = Collision)
	uint8 bGenerateOverlapEvents : 1;

Let us know what if any errors are left when you have confirmed these changes.

solved the bGenerateOverlapEvents error… now dealing with two more errors

Error Code
E0020 - Solved
MSB3075
(Refer to above pictures on the error log)

Update : Also solved the E0020 by adding this line on my VertexFactory.h file

#include "Runtime/Renderer/Public/MeshDrawShaderBindings.h"

So now left with the MSB3075

There is a lot of online conversation over the years on this error but I have not seen anything that convincingly specifies the cause.

Things people have tried that might work for you are:

  1. Clean rebuild:
  • launch your project from Visual Studio with the UE editor closed
  • select under the build menu, select Rebuild All
  • run the project from visual studio (which will start the editor for as long as you are running the project)
  1. Try compiling from the editor
  • For some people, this seems to have solved their problem
  1. Check your reflection parameters UProperty() etc. For some, the problem was caused by having incorrect parameters ( they would be in your header file, you may not have any based on what I have seen)

  2. Clean your intermediate build folder (variation on solution number 1) as described here: c++ - Permission error every time I build in visual studio 2015 - Stack Overflow

  3. Uninstall and re-download the engine

Hopefully one of these will work for you.

Double-click on the .sln file or start visual studio and “open solution”. You will then select the TestDrag.sln file in D:\Unreal Projects\TestDrag folder

Step 2 to 5 doesnt work sadly, but still going on for step 1, how to run the project from visual studio may i ask?