I have been following the Battery Collector Tutorials which were going well. After updating to Unreal 4.15.2, I compiled
my project which resulted in a crash. After a bit of research I checked the option “Editor Symbols for Debugging” in the Epic Games Launcher. But when I try to open my project another crash occurs, Here is the Crash Information:
#include "GameFramework/Actor.h"
#include "Pickup.generated.h"
UCLASS()
class BATTERYCOLLECTOR_API APickup : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
APickup();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Return the Mesh for the Pickup
FORCEINLINE class UStaticMeshComponent* GetMesh() const { return PickupMesh; }
// Return Whether or not the Pickup is Active
UFUNCTION(BlueprintPure, Category = Pickup)
bool IsActive();
// Allows other Classes to Safely Change Wheteher or not Pickup is Active
UFUNCTION(BlueprintCallable, Category = Pickup)
void SetActive(bool NewPickupState);
protected:
// True when the Pickup can be Used and False when the Pickup is Deactivated
bool bIsActive;
/** Simple colision primitive to use as the root component */
UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
USphereComponent* BaseCollisionComponent;
/** StaticMeshComponent to represent the pickup in the level */
UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
UStaticMeshComponent* PickupMesh;
};
In terms of where I am in the Battery Collector tutorial I was in the middle of video 5 in the series(some lines were updated due to unreal version differences). if you would like the code for the other header and cpp files, let me know
Kyle, Just to add I just did a build of the Battery Collector. The Build Failed showing the following errors:
Severity Code Description Project File Line Suppression State
Error System.UnauthorizedAccessException: Access to the path ‘C:\Users\Documents\Unreal Projects\BatteryCollector\Binaries\Win64\UE4Editor-BatteryCollector.dll’ is denied. BatteryCollector C:\Users\Documents\Unreal Projects\BatteryCollector\Intermediate\ProjectFiles\EXEC 1
Severity Code Description Project File Line Suppression State
Error Exhausted all retries! BatteryCollector C:\Users\Documents\Unreal Projects\BatteryCollector\Intermediate\ProjectFiles\EXEC 1
Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file ‘C:\Users\Documents\Unreal Projects\BatteryCollector\Binaries\Win64\UE4Editor-BatteryCollector.dll’ BatteryCollector C:\Users\Documents\Unreal Projects\BatteryCollector\Intermediate\ProjectFiles\LINK 1
Severity Code Description Project File Line Suppression State
Error MSB3073 The command ““C:\Program Files\Epic Games\UE_4.15\Engine\Build\BatchFiles\Rebuild.bat” BatteryCollectorEditor Win64 Development “C:\Users\Documents\Unreal Projects\BatteryCollector\BatteryCollector.uproject” -waitmutex” exited with code -1. BatteryCollector C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 42
I recently updated to unreal version 4.15.3. I wonder if this is a case of deleting the project and starting from scratch.
Are you using the “Compile” button in the editor? Or, are you building the project through Visual Studio?
If you are trying to build the project through Visual Studio while the editor is running, I can see you getting the “Path is denied” error because that DLL is loaded by the editor but Visual Studio is trying to access it. If this is the case, either close the editor or use the “Compile” button in the editor.
The problem lies in my original question. I cannot open my battery collector project because it crashes before it fully loads(crash log details on top of page).
The only way I can change or attempt to change the code is through visual studio and as you describe in your comment there are problems with this method. Therefore is it best to just delete the project and start again from Scratch?
Have you tried running the project from Visual Studio instead of the .uproject? This way you can run the program and edit it through Visual Studio in order to fix it.
Open the project through the .sln in your project folder:
Run the program with “Local Windows Debugger” in Visual Studio:
Have to see more of your code, I guess. Something is probably illegally referenced and crashes, because you have say, an actor in editor using that code. You’ll have to delete the erroneous code then recompile.
What happens if you bypass the code in ABatteryPickup?
I tried the Local Windows Debugger method and after the diagnostics is run an exception appears. It points to the GENERATED_BODY() method in the battery pickup, Here’s the BatteryPickup.h file:
After a bit more testing. I found a workaround. In my Battery blueprint mesh I
checked Simulate Physics and left the SetSimulatePhysics() method in the BatteryPickup.cpp file commented. Here is an image of how I did it:
I have that in my pickup.cpp(As instructed in the Battery Collector tutorials). Though I did update the code to the newer version of unreal. Here’s the lines: