[RESOLVED] Trying to anchor a collider/trigger to left side of screen so that it is always...

So this is the scene:

https://imgur.com/a/IpdSXJe

The object of the game is to swipe to throw the ball at targets that spawn from the right of the screen, moving along the conveyor. If a target makes it all the way across, the game over collider is triggered and causes a game over.

I have put red rectangles in the screenshots to represent the max/min aspect ratios and as you can see the game over trigger is too far away from the edge from the 9:18 aspect ratio causing a delay between the target going off the side of the screen and the game over being triggered.

I have tried creating a very simple script to fix the gameover gameobject to the left side and attaching it to the game object:

Vector2 worldPoint = Camera.main.ScreenToWorldPoint(new Vector2(0, 0));

But it doesnt work. I am very much a beginner so forgive me if I am going about this completely wrong!

I got that code from here: How can you position a gameobject in the world aligned to the screen edge? - Questions & Answers - Unity Discussions

Any help much appreciated!

Thanks!

is it all ? then you didn’t moved the object

private void Start()
    {
        //I have used Viewport here
        //(0,0)-left bottom and (1,1)-right top

        //calculate position
        Vector2 worldPoint = Camera.main.ViewportToWorldPoint(new Vector2(0, 0.5f));
        //move the gameobject
        transform.position = worldPoint;
    }

Ahh I see. Thank you so much! Works great now