Hey, does anyone have any clue why sometimes the widget material is not applying?
It keeps black like in this screenshot. It eventually come back working if I remove and re-add to my hand slots. Any clue?
19 Replies
not sure, @SirDigby {Mod Name} did you encounter this with Digby Tool at all?
there have been some pretty big changes to equipment actors this version, check the updating guide for more info. maybe it's getting disposed at a bad time or something
That's how I apply the widget as a material in all my equipments and buildings, now. For some I do at BeginPlay, for others that use multiple different widgets I switch from one to the other according to the target being aimed (like in Settings Copier). It used to be a floating widget within the equipment, but it had issues with different FOVs, so I used this solution, that someone taught me a long time ago
It eventualy work, but I have to unquip and equipe a few times to make it being displayed
maybe some "race condition"?
what if you run it again on equip and not just on begin play?
hmm
I will try that
but, it wouldn't explain the ones that change all the time, like the Copier, where it changes the widget according to what is being aimed, if machines, signs or trains
Same with mass upgrade, with belts, pipes or poles
And I also run it with a delay, maybe because it would not work properly already right away 🤔
can you add some code to debug, ex. prints saying what the material instance is while it's held? I wonder if the material instance is getting unset or if it's still set but erroring somehow
I will try that, just have to find a way to not overload the log 😅
Hmm... it returns None for the Get Render Target, at first. Curious 🤔
Maybe I should keep checking each tick until it no longer returns None... or increase the delay 🤔
But that still does not explain why the ones that change according to what I am aiming doesn't work, also, unless I unequipe and re-equip one or more times until it start working
found a way around. Not perfect, but it works, now
I incresed the timeout to 2s, and also added its setup to OnEquip, with the 2s delay, too
The Digby Tool didn't use a widget, so I'm no help here
Ah right, I think you used a material with a render target?
Yeah. Tried to copy what the vanilla object scanner uses
powersuit's hoverpack controllers will probably run into this but I haven't looked into it yet
object scanner has been rewritten
Solution
you need to re-initialize render target on equip
Yeah, that kinda did the trick
I used to do it only at BeginPlay (for single screen ones like Efficiency Checker ans Mass Upgrade). I also got issues with Settings Copier, but It was because the default screen would not initialize properly, and it is kept selected until some different building type is aimed, like Signs or Trains
If you guys are using object scanner as a template for an equipment with a widget I could give you the .cpp implementation of it so you don't have to actually inherit it for things that are not object scanner