When I make copy of 1 specific scripted object it doesn’t work

I have 2 objects a ball and a ufo I want to copy paste the ufo multiple times around the map but then I every time I need to go back to the ball script and put a reverence to the game object and add some more script is there a way to do this with a gameobject array and set active? ps I am a beginner can you make instructions please?

We don’t know what you doing with reference to UFO objects. This could be just a lack of development skills. You should ask yourself: Why do I need this reference there, and can I reverse logic? Maybe will be enough if you make a UFO script and inside will be a reference to one Ball object (reference one too many, not many to one).

We need more info on what you want to do so we can give a more precise answer.

this is the script I wrote inside the ufo but if I copy pate the object it doesn’t work

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

public class doosje : MonoBehaviour
{
    public GameObject deksel;
    public GameObject ball;
    public bool isActive;
    public Rigidbody2D _rb;
    public bool collided;

    private void OnTriggerEnter2D(Collider2D collision)
    {
        collided = true;
    }

    private void OnTriggerExit2D(Collider2D collision)
    {
        collided = false;
    }
    void Start()
    {
       
        collided = false;
    }

    // Update is called once per frame
    void Update()
    {
        if ((Input.GetKeyDown(KeyCode.Q) && collided))
        {
            isActive = deksel.activeSelf;
            deksel.SetActive(!isActive);
            _rb.gravityScale = (isActive ? 1 : 0);
        }
    }
}

There is still not enough information to give useful feedback.

You have a ball object, is it just an object in your scene, is it a prefab, does it get instantiated, is it a scriptable object?
You have an ufo object, … same questions
What is supposed to happen when the ball hit the ufo’s, or ufo’s hit each other, or ufo hit the ball.

Ok the ball is the player and I want the ufo to work when the player is in the ufo but the ufo works but if I copy paste the ufo the ufo will not work because the ufo instantiated to the ball so the script of the ball can use the ufo to turn the ufo on and off when the ball is in the ufo and I press q

replace every “it” in your text, with what it actually is. Ball, ufo, script, and so on. Share your code. This is all still not making any sense.

I changed it

What exactly do you mean by copy paste? Did you create a prefab of the ufo?

Yea I did make a prefab of it

That is a great start. However, you are just not sharing enough information/code to grasp what you are exactly trying to do and what the exact current flow is. I can’t help you any further without that.

Maybe take a look at how other people supply information for their problem.

Hey If your issue is still not solved contact me on discord
My discord id: codingbeast
if above one don’t work try this one
Muhammad Ali#9771

Your information is not enough only way to solve your issue is to see it while hapening.