Sorry to say that but i think you have no idea what you doing, i don’t know why you got error and what document you follow but i can see other serious issues i see that makes that error meaningless.
What you doing is actually creating a infinite loop, use SNew to create SParticleMeshWidget inside it self which would construct inside it self which would again construct it self and again and again until memory runs out… but since SMeshWidget is not compound widget (SCompoundWidget) you can’t even construct this widget out of other widget so it would not even work. Also note that SNew does not create widget it self it just constructs information about widget which will be used for construction, so you can’t just put it in middle of nowhere and expect that something will apper on the screen, it usually need to be send to Slate system one way or another which will place widget in widget tree. Normally SCompoundWidget contains ChildSlot variable that you set in Constructor with widgets you want to contain, but widget you trying to override was not made for that.
SMeshWidget is leaf widget (SLeafWidget) which is which is lowest level of Slate widget and don’t contain slots for other stale widgets it only renders widget with OnPaint function, and since you overriding existing leaf widget there really no reason to change constructor or else you really need to do some extra initial setting.
So you should start by investigating SMeshWidget code first and see what it does:
And as you look at it think what you need to modify, most crytical point is OnPaint which has main code of rendering MeshWidget and any modification of SMeshWidget behavior will land primerly there
Other huge issue i can see is your attempt to use UMG inside Slate code and even change “this” that may mess up function calling, this is something i never seen done (which makes me interested what document you working with here). Only reason why UMG exist is to make Slate work with Blueprints because Slate classes don’t exist in UObject hierarchy so it hard to hook them in to blueprints, insted wrapper system was made called UMG which contains UObject classes that controls the slate widgets and it makes them display on viewport out of the box. So Slate classes should be independent from UMG, insted you should make UMG class that controls your UMG widget (or composition of slate widgets which imo is superior way of using UMG then just overriding UUserWidget).
I don’t know what is your intention, if you don’t want to alter rendering of SMeshWidget and just use SMeshWidget in UMG then either:
1.Make SCompoundWidget and make UMG widget out of it
2.Just make UMG widget that constructs SMeshWidget
Option 2 is better as UMG widget class itself practically have similar function to SCompoundWidget, option 1 is only good if you plan to reuse the widget directly in Slate, which i don’t think is think you planing to do.
Also study Slate more since you clearly lacking knowledge on it i think you got yourself to too deep waters of it, study both Slate widget code in engine (Everything you see in editor is Slate so there countless examples in editor code, use Widget Reflector to check name of widget in editor) and check how UMG widgets are constructed and how they manage Slate widgets, those are contained in Componets folder in UMG module: