[Question] How to expose a function which runs from editor?

Hi all!

I have an actor which exposes a variable indicating the number of child actors that has to spawn and it works but I can only see the result when the game is running.
This actor is a grid manager which instantiates platforms.

How could I execute the function every time I modify the variable in the editor, so I can see the result before entering the game?

Thanks in advance :slight_smile:

I think if you put that functionality in the constructor event, that should get you on the right path

Do you have any images of your blueprints and code examples being used?

I tend to use the ā€˜PostLoad’ functions on actors. These are called when a variable changes in the editor. So you can setup a variable to be edited in blueprints (UPROPERTY(EditDefaultsOnly)) and then, in the overridden PostLoad function, you can use that variable to change certain things.

If you are spawning objects however, I believe these functions can only be called when the game is running.

Don’t forget ā€œ#if WITH_EDITORā€ macro:

Thanks all! I didn’t know that event existed… I’ll have to jump more into source code :slight_smile: