C# Acces public float other script

So while I was searching on the internet I actually found alot of answers to this, but I don’t quite understand it; and when I tried it I got the error ‘Object reference not set to an instance of an object’
So, bassicly this is what I have:
-a wall Prefab, with a code telling it to move down with a wallspeed
-the wall spawner, spawning the prefabs every x few seconds.
I added a timer to the wall spawner, and I based on time elapsed have stuff happen, Like change score, or increase speed of the wall prefab.

I don’t understand why this is so dificult to do in coding, I remember when I was learning actionscript 3 I also had massive problems accessing other functions and variables in other scripts…

this is the code what I have for the wallspawn:

using UnityEngine;
using System.Collections;

public class wallSpawn : MonoBehaviour
{
        public GameObject Wall;
        public float spawnTimeLimit = 1f; // 10 seconds.
        public float timePassed = 0f;

    // Use this for initialization
        void Start ()
        {
        GameObject theWalls = GameObject.Find("Wall");
        wallScript wallscript = theWalls.GetComponent<wallScript>();
        wallscript.wallSpeed = 50f;
//this is what is causing the trouble, I got this from the internet but dind't help.
        }
  
        // Update is called once per frame
        void Update ()
        {

The wall prefab just has a transform.translate(0, -wallSpeed… etc.

Thank you in advance!

You’re getting a reference to the wall by using GameObject.Find(…)
Then you’re getting the wallScript component off of it.
That reference tot he wallScript is null.
This means that the wall didn’t have a wallScript attached to it.

What gameobject comes back? Does it actually have a wallScript attached to it?

Instead of using ‘GameObject.Find’, try instead to attach the reference directly in the inspector.

I am kind of understanding what you mean, however that wouldn’t make sense because the things you mention; I have already done that (I believe so?).

Here you can see that the Wall has the wallScript attatched to it.

And this is the spawnmanager, you can see I attacthed the prefab to it. (I did this before adding the code I describe in this problem)

What do you mean with 'Instead of using ‘GameObject.Find’, try instead to attach the reference directly in the inspector’? How do I do that, and how would I be able to edit the speed then ?