- Home /
Which way is a better solution for UI creation?
Hi, i am wondering that which way would be a better solution for ui creation.Currently i am using 3d objects as buttons and for such things.Never used gui textures for the time being.Now i am wondering would it be better using a gui texture for performance purposes?All i do is creating a simple ray and checking which button is in interact with it and do sth over it.Also i won't have to deal with different aspect ratios and screen sizes since its a 3d object and no strechings etc as gui deforms. So i won't need to code that too.Could anyone give me some advices on whether should i stay on what i am doing or change the ui creation via gui?
Do you want the buttons to be 3D objects? If so, that way is "better."
Your current buttons, just sitting there waiting to be pushed, are you worried they aren't doing nothing fast enough?
$$anonymous$$y buttons are 3d objects that represent a 2d image on the screen that can be touched like a gui texture.They are doing their job perfectly, my concern is the colliders they have attached.I marked them as triggers so they won't interact with any of the rigid bodies in the scene but i am a little concerned if i am going on a messy road.
Answer by sparkzbarca · Dec 27, 2013 at 02:09 PM
sounds fine, you can just put them in a special layer if need be thats only casted against for button checks. Simple boxes with box colliders arent going to noticably impact performance so that matters not at all.
...and then if you really are worried, all game/non-GUI raycasts would say to skip items on that layer.
Thank you a lot for the comments guys.Since i am checking the buttons via bounds.IntersectsRay there is no need of layer :)
Your answer
