Look rotation viewing vector is zero in Unity when making UI

How can I tackle the problem: Look rotation viewing vector is zero?

Here is how I get it:

1. I add an Image from UI.

2. When the Image is added I click on it in the Hierarchy view.

3. When focus is on an Image I take the Canvas border and move it left.

4. I get the Exception.

Here are some screenshots of the process which takes place:

In the last screenshot I selected the Canvas and tried to focus on it by pressing F in the Scene view. As you can see I am not able to resize the canvas anymore. That means that I would have to create a new Canvas and copy everything into it, which is pretty tiresome and error prone. That is a reason I am concerned with the Exception. Will appreciate any attention.

1 Answer

I have recreated your problem and have found a way to fix it that may work for you. I believe the error is occurring because of the size of your Canvas being set to zero when you try to resize it in Overlay mode.

Firstly: You need to set your Canvas Render Mode to World Space, or else resizing the Canvas will not be possible (and will result in the error you received) as it will overlay the screen at a set size.

Secondly: To return to a view in which resizing the Canvas is possible you need to switch from Sprite mode to Position mode. Then move the Canvas a bit with one of the three axis. This is the way I was able to return to editing the Canvas' size. (I do not know why this works.)