How to make guiText adapt to different screen sizes/resolutions

Hello I’ve made a simple 2D ‘flappy bird’ type game just as a first time game and I’ve run across a small mishap.
The guiText elements in my game all come up as different sizes on different phones and i was wondering how I could fix this issue. For example on a 1080p 5" display the text fits just fine but then a 4.3" 720p the text goes all huge?

Hello! :slight_smile: I’m not 100% sure which version of Unity you are on, but as long as you are on 4.6 or higher this tutorial should help :smile: It’s less than 4 minutes so it won’t take much of your time!

Best of luck! :smile:

Hello so just a quick question

Do i need to recreate all my text to be a child of the canvas under Camera?

well apparently i need to recreate every all my text :I anyway i can add GUItext to it?
Or is there anyway I can make UItext blink on and off? I’ve tried getcomponent UItext but its not valid

Hi I’m so sorry! I think we are in opposite time zones :slight_smile:

You can drag the GameObject in the Hierarchy to be a child of an object without recreating it :smile:

To Access the UI Components you need to add the UnityEngine.UI Namespace. The code below is in C# :smile:

Hopefully that helps!! So sorry for the late response!!

Thanks a lot for your help I’ll try it later on :slight_smile:

1 Like