Ticking in Editor on a populated actor

Hey Guys

I’m trying to get an actor to tick in the viewport. Not in PIE, but while editing in the world.

I’ve extended AActor to a new class and added this code as has been suggested elsewhere:

.h

virtual bool ShouldTickIfViewportsOnly() const override;

.cpp

bool MyActor::ShouldTickIfViewportsOnly() const
{
	return true;
}

My problem is that it only seems to work when I have a blueprint inheriting from “MyActor” loaded up in the blueprint editor, and not actually when such blueprints are populated in the world.

I really just need a way to get a populated actor to tick in the editor and not just in PIE.

Any suggestions?

Looking for the answer to this as well

Make sure you that your viewport is set to real time so it actually updates

Actually ended up finding the solution but it’s kind of a hack/bug – it seems a native tick function will always run whereas the blueprint tick function, as the OP says, only happens if that blueprint is open in it’s own editor window. Very weird.

In this case I just made the code I wanted to run in blueprints stem off of a “BlueprintImplementableEvent, CallInEditor” function and am running that from my C++ Tick instead of BP Tick.

Version 4.18 btw

works nicely even now in 4.23, thanks for sharing the solution