C++ class with Blueprint properties

Sorry for the vague title, I didn’t know how to phase the problem with a sentence.

I made a C++ class that basically creates a grid of cubes. It has a property that defines the size of the grid:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GridActor")
FIntPoint GridSize;

When I place the actor in the world, I can change the size via the “details panel”, as can be seen in the picture:

But changing the size doesn’t update the actual grid. The grid is created in the constructor of the C++ class, so it doesn’t get called again when the “Grid Size” parameter is changed inside the editor.

How can I “tell” Unreal to fire the constructor of the object again when a parameter is edited in the editor? There must be a way to do it.
Or maybe there are other methods I can implement that are fired when properties are edited?

Yeah, but I would like it to update in the editor, so that I can design the level basically

Thanks a lot, that was what I was looking for! The documentation is not clear in that regard…

You’re right, I’m sorry I forgot! :slight_smile:

When you hit play, does the class update the grid?

Instead of putting the code in your constructor, use PostInitProperties.