Can only see ui elements from canvas in game screen

cud_s05_rigidbody__colliders

#1

anyone know why?


#2

Hi Dan, welcome to community :slight_smile:

A screenshot could be really useful here, perhaps on in Scene View with one of the UI objects selected in the Hierarchy so that it’s details are displayed in the Inspector.

It would only be a guess at the moment, but I would perhaps lean towards the transform position. If it was something like that, double-clicking on the UI object in the Hierarchy would re-focus the camera in Scene View to the object, so you would be able to tell if it was way out from the main play space. If that isn’t the case, then you could check other things like the Z axis value in the Inspector, e.g. is it behind something else. Sorting order can also be relevant, as can the order within the Hierarchy, but probably best to start with a screenshot and lets see if there’s something more easy to spot first :slight_smile:


#3

Thank you :slight_smile:

the course is great btw!!

it doesn’t seem to be the z axis, I tried resorting the hierarchy but doesn’t seem to do anything. il send a screen shot.


#4

Hi Dan,

Quite possibly one of these most distracting set of screenshots I’ve ever seen in my life! Often best to full screen the Unity editor window for these, can also conceal your personal stuff then :slight_smile:

Ok, so there’s some odd things going on in this scene and it’s hard to tell from the screenshots only, but typically in a new scene the camera will be centred on 0, 0, 0. You have the ball GameObject set at 130, 145, 0 - I wouldn’t expect to see that in the playspace with the default camera view, it also has a massive scale doesn’t it? 23x! The block is also set on the X and Y in the hundreds, rather than anywhere near 0, so at the moment, if I had to guess, I’d say you have these game objects just outside of the camera view port.

Try this,

Select the ball and set its transform to 0, 1, 0. Then select the block and set it’s transform to 0, 0, 0.

What do you have the pixels per unit set to for the ball sprite? That seems a very large scale to be applying.


#5

Hi Rob
It seems I am having the same issue. The object appears on the scene panel but not on the game panel. When I run the game everything works in the scene panel but not on the game panel.

I have attached screen shots of the ball, block, background image, camera, and canvas.

Also I am not sure whats happening with the button “Next level” . It is oversized in the scene panel but somehow in the game panel it appears reasonably sized. Does this have anything to do with anchoring???
(I attached a screen shot of the button below too.

Id appreciate your help
BTW thanks for the fun course. I haven’t had any issues so far.

Ball

Block

Camera

Canvas

Background

Next Level Button below


#6

I’m having trouble seeing the screenshots on my phone, but if UI elements are not showing in the scene view, its likely that the UI layer (under Layers near the top right, above the inspector) is toggled to not visible.


#7

As far as the scene view and game view looking different, you can probably click on your Main Camera, then go up to Edit at the top (or GameObject) and click Align To Selected.

This should re-orient your scene view to match the camera’s current game view.


#8

BigO, try setting your camera position to 0,0,-10.

Do something similiar to the above. Click on your Main Camera, go to Edit at the top, and click on “Align With View”. This will move your camera so that it sees what you see in the scene view.


#9

I checked the “Layers settings” Everything seems to be set to visible.
Screenshot below


#10

Tried this too. Didnt really solve the issue. Im attaching the screenshots showing the difference I am talking about more clearly.


#11

BigO:

Okay, yeah those look perfectly normal.
One of the oddities about Unity’s UI system is that even though it even though it is portrayed in World Space, it doesn’t really occupy the same space as the rest of your world. Your world objects will often be at a certain scale, while your canvas is much, much larger.

This is because the size of your canvas is like '800x600 or something like that. When shown in World Space, that’s huge! Your background is only like 16 units wide while the canvas is 800 units wide.

This is okay and perfectly normal.

It doesn’t matter because the canvas will be scaled to your screen view when you actually play the game.

You’ll probably want to use the Layers menu to hide the UI when you are not working on it.

(To easily look at your UI, click on the canvas and press ‘f’ (or I think double clicking works too). Then to work with your normal objects, click on an object and press ‘f’ or double click.)