Hi. I have this problem. BeginPlay() event not firing.
So this is my second project beside tutorials and i have just started it.
I have only two classes with simple code so I don’t think problem is in code.
I tried to trigger function Shoot() from BeginPlay() but it didn’t worked so I tried print in console directly in BeginPlay(), also didn’t worked, so I did same thing in my gamemode class.
It is probably simple proble, but like I said I am beginner.
CharacterController.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "CharacterController.generated.h"
/**
*
*/
UCLASS()
class PROJECT2_API ACharacterController : public APlayerController
{
GENERATED_BODY()
protected:
virtual void BeginPlay() override;
void Shoot();
};
I can’t say for sure what the issue is with this data, but there was a few things that came in mind.
First, your C++ code there is perfectly valid, so nothing to worry there.
One thing I would recommend checking though is that you don’t Override the Default GameMode in the world settings. If you don’t know what am I talking about, or you know that you haven’t been editing the world settings, then I don’t see it being the issue.
Another potential cause the problem, especially for a beginner, is the debug message it self.
So first of all, make sure you are looking for the message in the Output Log not the Message Log (I have seen people mixing these two up).
Another thing that could’ve happened is, that you’ve simply missed the message as the verbosity you are using is Display (Display=White, Warning=Yellow, Error=Red). I personally recommend using Warning for debugging purposes.