As the title says, my player controller’s tick function is called when I open it in the blueprint editor. My blueprint inherits from a custom player controller c++ class. You can take the following steps to recreate it.
Create a class that inherits PlayerController
Override the tick function and have it print to the console.
Create a blueprint that inherits your custom class
Open the new blueprint in the editor
Now your poor log will be spammed
Resulting C++
Header file
#pragma once
#include "GameFramework/PlayerController.h"
#include "MyPlayerController.generated.h"
UCLASS()
class BUGREPRODUCTION_API AMyPlayerController : public APlayerController
{
GENERATED_BODY()
virtual void Tick(float DeltaTime) override;
};
I came up with a hacky workaround if you overwrote your tick method with C++.
void MyPlayerController::Tick(float DeltaTime)
{
if (GetWorld()->WorldType == EWorldType::EditorPreview) return;
// the rest of your tick function...
}
Add the 3rd line to the top of your tick function. The code is checking the world type. When the blueprint editor calls the function (which it shouldn’t) the world type is “Editor Preview”. So if WorldType == EditorPreview, return!
If you overwrote the tick function in blueprint, I don’t know how to help since you won’t be able to open it (if the resulting code causes the editor to crash) I don’t like hacks so hopefully we can get this resolved soon