Skip to main content
1 of 3

Script not working on object in unity 2D

I was following a tutorial where the gameobject was to spawn randomly within the screen. The code I used is as follows.

enter image description here

But on running the game it stays in the same location

enter image description here