Unity and Swift Colliding when using ARKit - swift

I am using Xcode 10. I am using Unity with my app, I render a view with Unity content and it worked fine until the aspect ratios of iPhone plus sizes and now iPhone XS Max, XR etc.. The problem is the unity view doesn't show in fullscreen, it repeats itself weirdly. As you can see in the picture below. I have constrained this view to the top and bottom. Also applied Equal-Width and Equal-Height constraints on this view with superview. Any guesses why this is happening?

Related

Unity, at higher resolution (2560 x 1440) tester cannot click the navigation elements on the screen even though they are in position

Here is my issue, the way my game works is that you click on the edges of the screen to navigate. This is done through an Overlay Canvas using OnPointerClick. I colored the navigation areas, and scale the canvas according to screen size and the navigation areas appear on their screen as they should. Yet they CANNOT click any of the elements for some reason. They have another monitor that works without issue. They've noted that their larger monitor is AMD. I've also confirmed that the ability to navigate in game has not been hindered. I have never had this issue (or any other testers) on 1920x1080 monitors.
I have completely exhausted what the issue can be, they cannot even navigate on a bare bones tutorial. Any ideas would be GREATLY appreciated.
Here is an image of their screen and the respective clickable navigation areas.
[img]https://i.imgur.com/NVQkA8g.png[/img]
Unity 2019.2.14f1
Put a Image component without sprite, because without that, you will not detect any click. You can set the alpha to 0 after you see that working.
Also check the anchors of the navigation areas.

Resize element to fit screen size in spritekit

Obviously, you can use UIScreen to find the screen height/width to adjust the scene accordingly, but is there some way I can update all my SKSpriteNodes at once? I made a game with spritekit and only realized afterward, none of it was based on screen size, so it only works well on the iPhone 7 and 8. Is there some shorter code I can do instead of manually changing each size/location to be based on screen size?
I figured out a solution. I made a SpriteKit Scene in the storyboard and then constrained it to the Safe Area, which allowed aspectFill to work properly.

Black bar on top and bottom of screen in Samsung Galaxy S 8

My game, developed with Unity, runs in portrait and full-screen mode. There is no problem in any device except Samsung Galaxy S8, in which the full-screen mode doesn't exactly work and as you can see in the attached picture, there are black bars on the top and bottom of the screen (assume the white part is the game area). Funny part is there is absolutely no problem in S8+, which I believe has the same exact aspect ratio (18.5:9). What should I do? I am using Unity 5.6.6 and can't upgrade it.
Add (and familiarize yourself with) a CanvasScaler component to your Canvas.

Zooming doesn't work in Unity although FOV changes

I am working on a 2D project and I want to zoom in my map by scrollwheel. I am sure that my code is working (because during the play mode, field of view changes when scrollwheel is rotated) but no change on the screen is observed.
Besides, during play mode even if I change the field of view manually (from the editor), the screen view remains same. That is, although field of view is observed to be seen changing but the screen view is not.
What are the possible reasons for that?
Here is the screenshot of the editor attached:
Possibly because you're using screen space canvas. Put the canvas in the world space for field of view to have any effect.

Canvas too big for the camera in Unity

I have created a 2D game with an orthogonal camera and using 16:9 display size.
I dragged my background image onto the hierarchy (it's about 2048x1152) and then set the camera size to be 22.5, which made it fit the background perfectly and displays just right.
However, when I add a Canvas for a UI it is absolutely giant, about 100 times bigger. It only becomes 'normal' size with respect everything else added when I set the camera to its default size of 5. So when I add a small graphic, it too becomes giant.
I'm simply following a book I read and I'm not doing anything to deviate.
Am I doing something wrong? Below is what I mean. The background image is the little image in the bottom right and the outlined rectangle is the canvas with a small graphic added.
Thanks.
To force your Hierarchy Canvas UI to the same resolution as the Camera View in your Unity Editor Scene window resolution (i.e. not ridiculously massive), or in other words get the Canvas to fit into the Camera size in the Scene, do the following:
Set the Canvas component's Render Mode to Screen Space - Camera.
Make sure you select or drag the relevant Camera from the Hierarchy to the Render Camera field in the Inspector.
You should use the Unity canvas for this along with the canvas scaler component. If I'm not mistaken it will scale all elements relative to the screen they are viewed on.
The canvas scaler allows you to match the scaling based on a preferred viewport size which is a life saver.
However this may not fit you needs perfectly as it would mean that the background element would become fixed. So if you wanted to pan the element you would need to move it's x and y elements within the canvas.
Hope that helps?