'spawnPoint' does not exixst

Hello there!

So I’m new into making games, I’ve just done a fev python projects but never in any other software than html. Now I’m interested in creating games, and what better than start making a 2D Android game? So I’m just half copying a tutorial just to get used to this. While writing the code I got this error;

Assets\Scripts\GameManager.cs(43,28): error CS0103: The name ‘spwanPoint’ does not exist in the current context

I’ve been searching for possible solutions but idk if that’s the solution, they talked about something called RigidBody.

Here’s the code, thanks!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{

    public GameObject block;
    public float maxX;
    public Transform spawnPoint;
    public float spawnRate;


    bool gameStarted = false;


    // Update is called once per frame
    void Update()
    {
        
         if(Input.GetMouseButtonDown(0) && !gameStarted  )
         {
             StartSpawning();

             gameStarted= true;
         }


    }




    private void StartSpawning()
    {
        InvokeRepeating("SpawnBlock", 0.5f, spawnRate);
    }



    private void SpawnBlock()
    {
        Vector3 spawnPos = spwanPoint.position;

        spawnPos.x = Random.Range(-maxX, maxX);

        Instantiate( block, spawnPos, Quaternion.identity );


    }
}

The error was that you wrote spawnPoint incorrectly. (you wrote spwanPoint)
Here’s the code fixed:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{

    public GameObject block;
    public float maxX;
    public Transform spawnPoint;
    public float spawnRate;


    bool gameStarted = false;


    // Update is called once per frame
    void Update()
    {
        
         if(Input.GetMouseButtonDown(0) && !gameStarted  )
         {
             StartSpawning();

             gameStarted= true;
         }


    }




    private void StartSpawning()
    {
        InvokeRepeating("SpawnBlock", 0.5f, spawnRate);
    }



    private void SpawnBlock()
    {
//The error was here. You wrote spawnPoint incorrectly. Before: spwanPoint
        Vector3 spawnPos = spawnPoint.position;

        spawnPos.x = Random.Range(-maxX, maxX);

        Instantiate( block, spawnPos, Quaternion.identity );


    }
}