I was following a tutorial where the gameobject was to spawn randomly within the screen. The code I used is as follows.
using System;
using System.Collections.Generic;Collections;
using System.Linq;
using SystemCollections.Text;Generic;
using System.Threading.Tasks;
namespace TestUnityEngine;
{
public class Program
NewBehaviourScript : MonoBehaviour
{
static void Main(string[] args)
// Start is called before the first frame {update
Console.WriteLine// jump ("Enterlocation input");support
//screen dimensions
intfloat answerminX = int.Parse(Console-3.ReadLine());77f;
float maxX = 3.73f;
float minY = switch(answer)-2.13f;
float maxY = 2.16f;
//timer {support
const float TotalJumpDelaySeconds = 1;
float caseelapsedJumpTimeSeconds 1:= 0;
// Update is called once per frame
void Console.WriteLineUpdate("You did it.");
{
//update timer and check if its done break;
elapsedJumpTimeSeconds case+= 2:Time.deltaTime;
Console.WriteLineif("You didelapsedJumpTimeSeconds it>= again"TotalJumpDelaySeconds);
{
break;
elapsedJumpTimeSeconds = 0;
Vector3 position = }transform.position;
if(position.x answer>2= ||Random.Range(minX, answer<1maxX)
{;
position.y = ConsoleRandom.WriteLineRange("You're anminY, idiot."maxY);
}
}
}
}
But on running the game it stays in the same location
Here is the code in text

