How to create toggle to change varibles

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

public class AppleTree : MonoBehaviour
{

    // Prefab for instantiating apples
    public GameObject applePrefab;
    public float Speed;
    public float maxSpeed;

    // Speed at which the AppleTree moves in meters/second
    public float speed = 2f;

    // Distance where AppleTree turns around
    public float leftAndRightEdge = 15f;

    // Chance that the AppleTree will change directions
    public float chanceToChangeDirections = 1f;

    // Rate at which Apples will be instantiated
    public float secondsBetweenAppleDrops = 1f;

    void Start()
    {
        // Dropping apples every second
        InvokeRepeating("DropApple", 2f, secondsBetweenAppleDrops);
    }

    void DropApple()
    {
        GameObject Apple = Instantiate(applePrefab) as GameObject;
        Apple.transform.position = transform.position;
    }

    void Update()

{
        // Basic Movement
        Vector3 pos = transform.position;
        pos.x += speed * Time.deltaTime;
        transform.position = pos;
        // Changing Direction
        if (pos.x < -leftAndRightEdge)
        {
            speed = Mathf.Abs(speed); // Move right
        }
        else if (pos.x > leftAndRightEdge)
        {
            speed = -Mathf.Abs(speed); // Move left
        }

        if(Speed < maxSpeed)
        Speed += 0.5f * Time.deltaTime;


{
        if (Input.GetKey("escape"))
        {
            Application.Quit();
        }
    }





    }

    void FixedUpdate()
    {
        // Changing Direction Randomly
        if (Random.value < chanceToChangeDirections)
        {
            speed *= -1; // Change direction
        }
    }
}

Hello there, so I’m trying out an apple picker game prototype from a introduction book (I’m a beginner) and I want to find a way to simply add a toggle in the code that changes or adds variables to the speed .

Let me google that for you.

While I appreciate the screenshot, it would be nice if you could give me some guidance. Or a more specific answer.

Your question was completely non-specific:

And the tutorials online will ALL tell you exactly how to do this.

If you are unwilling to watch a tutorial, why should I think you’ll actually read anything that I type to you here?

Good luck.

Look I don’t wanna start anything bad. I’ve tried to watch tutorials but either I couldn’t understand what they meant or if I had a question it wouldn’t be guaranteed to be answered. That is why I came here since the forum more active. I’m willing to learn.