I’ve frequently found a need to access a subsystem from a viewmodel context. Would Epic be interested in a change that adds meta=(ShowWorldContextPin=“true”) to UMVVMViewModelBase?
Steps to Reproduce
Make a blueprint viewmodel with base class UMVVMViewModelBase. Attempt to get a world subsystem reference. Hit compile. Editor complains about needing a context object but does not spawn the pin.
Hi Phil,
That seems like a reasonable change, I’ll run it by the team to see if we can get that in for a future release (probably 5.7). The other option would be to extend the MVVM base class in C++ and implement UObject::GetWorld yourself, but I think exposing the context pin is a bit more friendly.
Best,
Cody
Hi,
Quick update, this change is now submitted to UE5 main at CL#42117577. That should make it’s way into the 5.7 release.
Best,
Cody
Thanks!