#np, it won't take too long . . .
1 messages · Page 1 of 1 (latest)
It seems to be working! I think I've done it correctly. I put the CanvasGroup component on the Canvas (parent object that has the image for crosshair and TMP text both as children). I assigned that Canvas to the PlayerInteraction in the unity editor.
Here's my updated script (I only changed this one). https://pastebin.com/WPR94QHZ
I feel like I broke something since things never seem to just work on my first time trying things but maybe this is correct? Anyways the jitter is gone so thanks a ton for the suggestion! Is it bad practice to have TMP elements load in mid-game? I never had issues with this in my past prototypes, but my workings with UI elements is very limited.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
it's only a problem if you're instantiating and destroying the text, but that's not your case. honestly, i'm surprised it jittered. it could just be the editor: viewing in the editor does put more load on resources. testing in playmode with fullscreen will remove some jitter and fps issues because the editor is not in view
typically, i de/activate text and other GameObjects with object pooling which is more intensive than dis/enabling a single component (your method). it could be somethnig else. at least it works, for now . . .
also, as you have seen, using a canvas group will affect all UI children of the parent GameObject. this allows you to fade in/out entire windows, widgets, etc., in your code . . .