❔ Prefab different sizes on 2 different monitors.
I'm working across 2 different computers with 2 different monitor resolutions. I have a prefab which is the right size on one monitor, but too small on the other. How can I get them to be the same size on both.
I notice the game over text has a canvas scaler which has a 'scale with screen'option. Do I need to incorporate something like that? Thanks
11 Replies
You have to zoom in based on the window ratio, yes pretty much a scaling script.
is this just a developing the game issue,? what about when (in theory) people playing the game at home on there comps?
there's scalemode under canvasscaler
set it to either follow your screen width or height
also you should anchor things so you're ui would be consistent on multiple resolutions
I don't think this is regarding UI
But world gameobjects
he mentioned something about canvas scaler, so I assume it's UI stuff
It's not UI, I was using it as an example. It is for a prefab, so don't seem to have access to canvasScaler
well then that's super weird
proly make sure you have them setup properly I guess
it's 2d or 3d game?
2d
on the prefab, what setting would affect the scale to make it universl?
you can do screen-to-world conversion
then multiply it by 2 to get the height
and do the same with the width
that's how we used to do it in the old Unity versions, I'd not be surprised if this already supported as part of the Sprite renderer component
you should check if there's a ready made component for that in the component tab
I believe if Camera is set to orthographic, the size should be equal by all resolutions.
If it isn't set to orthographic you have to manually scale it.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.