Editor Utility Widget (How to save changes) [SOLVED]

I’ve built a simple one-button widget that gets a reference to an actor in the editor level and randomizes a few of its variables. I can see the variable updating properly in the actor’s detail panel and also in the viewport. Good. BUT, these changes do NOT mark the level as “unsaved” and selecting “save all” from the menu and then reloading the level reverts all changes that the utility function made. The only way to save changes is to manually tweak something in the level after running the widget (which of course marks the level as needing to be saved). What am I doing wrong?

SOLVED. I had to use the “Set Editor Property” node instead of simply casting to the actor and modifying the variable.

For those like me who are just beginning to learn Editor Utilities, this is the setup I used.

3 Likes

instead of simply casting to the actor and modifying the variable

I’d like to extend this a bit: i’m still simply GetAllActorsOfClass(), then Cast<>(), then modify variables, but the function you provided was made into utility i’m calling on object after all modifications:

note: bCanBeDamaged is a random AActor’s property i’m 100% not using