#Centering mesh in center of screens on different mobile devices?

1 messages · Page 1 of 1 (latest)

charred obsidian
#

Hello, I am working on a scene that has no camera movement, and I want the ability to place a mesh directly in the center of the screen regardless to the screen resolution. Is the only way to do this via code?

granite lantern
charred obsidian
#

I also found out about Cinemachine/Timeline.

#

It gets a little much

granite lantern
#

I'm no longer sure what problem is being solved

charred obsidian
#

I just want to have a model centered on all mobile devices

granite lantern
#

Scaling an object to screen is different from centering

charred obsidian
#

I thought everything I provided was camera based

granite lantern
#

Unity's cameras already adapt to any screen resolution, as well as aspect ratio

charred obsidian
#

My apologizes, I'm very new. So, if I use position X=0, Y=0, then it will be in thr same place on all screens. Is that what you are saying?

granite lantern
#

Relative to camera, yes

charred obsidian
#

You understand my goal correct? It seems that there is no issue? Its all relative?

#

X=0, y=0 will always start at the center of everyones screen

granite lantern
#

Yes, if the camera is facing that point

#

Whether your user has a 1080p screen or 8k screen it'll look the same, only fidelity changes

#

If aspect ratio changes, then the horizontal screen proportions will change
But I think all mobile devices are 9:16
You can use the Game window's dropdown to preview any type of screen

charred obsidian
#

Yeah. I've been using the one for my andriod. I think there are some minor differences but not too much.

#

I will make sure there is buffers to allow for things to get cut off.

#

Ok. Thank you for explaining. I will test and learn more. I just wanted to make sure I wasn't making any fundemental mistakes

granite lantern
#

If the resolutions and aspect ratios in the dropdown match real screen dimensions, they will visualize any differences

charred obsidian
#

That makes sense.

granite lantern
#

I think it only would make a difference if your game needs to look the same or similar in landscape and portrait modes

#

But even for PC I believe non 16:9 aspect ratios are vanishingly uncommon

charred obsidian
#

That isn't required. I was thinking that I would have certain scenes forced into landscape but none would have to support both

granite lantern
#

Not totally sure but I think in that case you have the option to rotate the camera, or to resize its size / fov

#

Camera size and fov are in vertical units

charred obsidian
#

I'll cross that bridge when I get to it. Enough directly in front me.