Get a variable from another script

Hello everyone ! I come here today because I need help with my script…
I’m very sorry, I looked everywhere in internet but I’ve got this bug since one very long week.
So could you please help me ?

Here is the scripts :

First script :

using UnityEngine;

public class ladder : MonoBehaviour
{

public bool isInRange;

GameObject[ ] playerMovements = GameObject.Find(“Scripts”).GetComponent(“movements”).isClimbing;

// Start is called before the first frame update
void Awake()
{

}
// Update is called once per frame
void Update()
{
if (isInRange && Input.GetKeyDown(“E”));
{
playerMovements.isClimbing = true;
}
}

private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.CompareTag(“Player”))
{
isInRange = true;
}
}

private void OnTriggerExit2D(Collider2D collision)
{
if (collision.CompareTag(“Player”))
{
isInRange = false;
}
}
}

Second script :

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

public class movements : MonoBehaviour
{

public float moveSpeed;

public float moveSpeedLadder;

public Animator animator;

public SpriteRenderer spriteRenderer;

public bool isClimbing;

public bool isInRange;

private bool playerMovement;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

if (!isClimbing)
{

if (Input.GetKey(KeyCode.D))
{
transform.Translate(new Vector3(moveSpeed, 0, 0));
animator.SetFloat(“Speed”, 2);
spriteRenderer.flipX = false;
}
if (Input.GetKeyUp(KeyCode.D))
{
animator.SetFloat(“Speed”, 0);
spriteRenderer.flipX = false;
}

if (Input.GetKey(KeyCode.Q))
{
transform.Translate(new Vector3(-moveSpeed, 0, 0));
animator.SetFloat(“Speed”, 2);
spriteRenderer.flipX = true;
}
if (Input.GetKeyUp(KeyCode.Q))
{
animator.SetFloat(“Speed”, 0);
spriteRenderer.flipX = true;
}
}
else
{
transform.Translate(new Vector3(0, moveSpeedLadder, 0));
}
}
}

So my problem is that I need to get the variable “isClimbing” from the first script to use it into the second one. But it doesn’t work.
I’m not quite good at C#, sorry if the error is obvious, i just need some help.
Thanks for every help you could give and good day to you !

Please use code tags: Using code tags properly

You need to create a public variable to hold a reference to the other script that contains the variable you want, set it up properly in the inspector, then access the other script via that variable.

Google perhaps for “unity make public references”, or pretty much any tutorial out there will somewhere contain this process, as it is essential to all inter-script communication.