Reputation: 625
I have a GameObject in a scene but not in the Canvas. In this GameObject I am instantiating a couple of other GameObjects without any problems.
What I do not understand is that, it doesn't matter if I set the main GameObject's Width and Height to 0 or 100 or 1000, nothing changes, it will still instantiate and display everything in the same way.
Can someone please explain me why it still displaying everything when I set the main GameObject's width and height to 0?
Thank you.
Upvotes: 2
Views: 1343
Reputation: 15941
RectTransforms
only matter to Canvas objectsWidth and Height are properties only available to RectTransform
type Transforms and only matter for Canvas objects. For non-canvas objects you should just use a normal Transform
at which point you will have a scale parameter, which setting it to zero, will make the object have zero size.
Upvotes: 4