x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

-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?

alt text

alt text

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

Product Version: UE 4.22
Tags:
helpme.png (25.9 kB)
help.png (22.8 kB)
more ▼

asked Aug 13 '19 at 12:26 PM in C++ Programming

avatar image

Moppey
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

4 answers: sort voted first

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)
 {
 
 }
more ▼

answered Aug 13 '19 at 02:32 PM

avatar image

danielf94
173 5 8 9

avatar image Moppey 5 days ago

alt text

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?

lessproblem.png (40.0 kB)
avatar image danielf94 5 days ago

Did you refresh your visual studio project?

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

avatar image danielf94 5 days ago

I checked my code and if it works

avatar image Moppey 5 days ago

sadly the same error occured... already refreshed my visual studio

avatar image danielf94 5 days ago

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.

avatar image Moppey 5 days ago

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();
 }
 

alt text

newproblems.png (33.0 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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: https://docs.unrealengine.com/en-US/API/Runtime/Engine/Components/UPrimitiveComponent/index.html (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.

more ▼

answered Aug 14 '19 at 02:57 AM

avatar image

MCX292
128 2 2 2

avatar image Moppey 5 days ago

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

alt text

lesserproblem.png (17.3 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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)

2) Try compiling from the editor

  • For some people, this seems to have solved their problem

3) 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)

4) Clean your intermediate build folder (variation on solution number 1) as described here: https://stackoverflow.com/questions/44554434/permission-error-every-time-i-build-in-visual-studio-2015

5) Uninstall and re-download the engine

Hopefully one of these will work for you.

more ▼

answered Aug 14 '19 at 03:02 PM

avatar image

MCX292
128 2 2 2

avatar image Moppey 4 days ago

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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

more ▼

answered Aug 15 '19 at 02:32 AM

avatar image

MCX292
128 2 2 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question