CMZTECH.NET
  • Blog
  • Graphics
  • Virtual Reality
  • 3D Printing
  • Fun Stuff
  • Contact

Unity UI Issues

2/17/2021

0 Comments

 
Unity UI has been giving me headaches. I suspect that I may just be using it completely wrong.  I have 5 canvases and I chose in script which is currently displayed.  The problem being that the ui elements don't really seem to like or respect being made inactive.
One isssue I had for ages was the caret (cursor) on an input field trying to update itself despite being marked as inactive.  This created a bizzilion warnings in the console which were just annoying at first... later I think there really was a big where that input field was getting input when it shouldn't have been.
Fixed that by marking the input field inactive 

 playerNameField.DeactivateInputField();
 playerNameField.enabled = false;

https://answers.unity.com/questions/867765/deactivate-input-field-not-set-interactable-to-fal.html


In the process of trying to fix that one, or maybe updating to a new version of the unity editor, somehow all my UI buttons got set to have "automatic" navigation.  This again meant they were stealing input and doing stuff when they shouldn't.  Particularly when Enter or Space was pressed.  Arrghhhhh. 

Found the solution in a 6 year old support ticket... 
https://answers.unity.com/questions/859460/button-is-being-triggered-by-spacebar-after-clicke.html


One good thing that came out of all this was I did find the rollout in the editor that lets you set the rules for an input field, so I can set that to alphanumeric and then get rid of the code I'm currently using to sanitize file names.

Anyway like I said, I suspect I'm trying to do something weird and I should have sat down and spent a week learning the UI system instead of assuming I could just lash something together using common sense.  Doh.



0 Comments

Unity Screenshot with UI

1/24/2021

0 Comments

 
You'd think that taking a screen shot would be easy... but no, not if you want to have the game UI visible. 
Basically the UI get's rendered some time after the camera considers rending is complete so you have to use a co-routine to get the screen shot function to fire at the right time....
This is another "dave won't remember this if he doesn't write it down" post.

Picture
0 Comments

Unity UI Scaling

1/24/2021

0 Comments

 
Unities UI is designed to scale to handle different resolution screens. This is great but you probably want the UI to look at at the intended resolution rather than looking good in the scene editor.  To preview the UI while designed it at the intended resolution (in my case 1080p) you can set it thus:
Picture
Of course thenthe UI looks ugly in the scene editor because it's scaled but.. le sigh....I guess tweak the window size to get 50%.

0 Comments

Unity Camera Depth

1/18/2021

0 Comments

 
Unity has this concept of Camera Depth.  It's got nothing to do with the zbuffer, it's the order that the cameras get rendered if you have more than one camera active.   Somehow my main game camera got set to a camera depth of -1 when I added another camera which meant that even if it was the only camera active it didn't get rendered.  So that's an hour I can never have again. 
If your camera mysteriously stops working despite the fact you can see it working just fine in other camera views...  this could be your problem. 

https://answers.unity.com/questions/418471/camera-preview-is-okay-but-game-view-is-not.html



Picture
0 Comments

View Camera Frustum Whilst Editing The Scene

1/18/2021

0 Comments

 
You'd think that making the camera frustum visible in the scene editor would be simple but it's not.
Here is a work around.
  • Select the camera you want to look through
  • Lock the inspector (this will mean Unities camera preview stays visible)
  • Add another inspector tab to edit objects with

Tip from:  https://gamedevworks.com/blog/unitytips-lock-camera-preview-window/

This is another "Dave won't remember this if he doesn't write it down" post.

Picture
0 Comments

Tiled Components In Blender

1/12/2021

0 Comments

 
I'm building out a tiled level in Blender for export to Unity.  I have a series of tile components and I want to texture them in Substance but I need the textures to match with regard to density and scale.  I found a trick for this.  If I select all three objects and go into edit more, I can select all the UV coords and do a Smart UV Project.  This means all 3 tiles share the same texture but also means they are scaled consistently. The only problem I found was that smart project sometimes rotates faces to pack the UV map.  My solution to this was to use masking in Substance to get the fill layer textures to match.  It's not perfect, but its better than trying to get the faces to scale manually across multiple UV sets.
Picture
Here you can see in substance I used layer masks to all for rotating the brick texture to match the UVs.  Getting the final alignment with the offset tool was a bit tricky, but it works.
Picture
This is another "Dave won't remember this if he doesn't write it down" post. 
0 Comments

Unity Cracks in Shadows

1/11/2021

0 Comments

 
I had weird cracks in my Shadows.
Picture
Reducing Bias and Normal Bias appear to fix or reduce this... and I don't have time to read up on why... 
Picture
This is another one of those if I don't write it down I won't remember posts... because I have a memory like a goldfish.  Here's the fix... and the credit.... 
0 Comments

Unity Text-Mesh-Pro Sort Order

1/8/2021

0 Comments

 
How to get Unity text mesh pro (tmp) objects to render last or without clipping for HUD elements.
TBF, I'm not really sure what TMP is doing and I don't really care, but changing the shader seems to do what I want.  This is the right shader on PC.  For some reason my project defaulted to a different one.
This is another "Dave made a blog post because he'll forget if he doesn't write to down" blog post. 
Picture
0 Comments

My Biggest Blender Project So Far...

11/4/2020

0 Comments

 
This was the project I worked on in the first 2 months of UK lockdown.  I'd say it was 2 months full time work and lots of mistakes were made.   I've been away for most of the summer, it's been a crazy year, but now I'm looking back on it and looking to see what I could do better next time. 
I need to learn how to make outdoor environments, and I need to learn to to do retopo so I can have better facial animation. 
0 Comments

3D Printed Bootleg Toy

11/4/2020

0 Comments

 
I accidentally got my 9 year old nephew hooked on some little blindbox action figure toys called SuperZings.  We worked together to design our own SuperZing.  He did the concept work and then I modeled, printed and painted the toy using Blender and my Ender3.
Picture
Copying the concept art in Blender
It was a fun little project and hopefully it inspires him to think creatively or something. 
Picture
0 Comments
<<Previous

    David Coombes

    Making stuff

    Categories

    All
    3D Graphics
    3D Printing
    3D Scanning
    AI
    Blender
    Cycling
    Development
    Environment
    Futurism

    Archives

    January 2021
    November 2020
    May 2020
    April 2020
    March 2020
    February 2020
    December 2019
    November 2019
    September 2019
    August 2019
    July 2019
    January 2019
    December 2018
    October 2018
    August 2018
    June 2018
    April 2018
    March 2018
    February 2018
    January 2018
    July 2017
    June 2017
    May 2017
    April 2017
    March 2017
    January 2017
    September 2016
    August 2016
    July 2016
    May 2016
    April 2016
    March 2016
    December 2015
    November 2015
    August 2015
    July 2015
    June 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014

    RSS Feed