Physics.Raycast ignores instantiated objects.

I have objects being spawned on the scene and they perform some actions when hit by Raycast.

If I drag a prefab to the scene manually it works fine, but if objects are respawned(so they are clones), they ignore raycast.

the code which launch those actions is the following:

public void Spin()
	{
		RaycastHit hit;
		Ray ray = new Ray(camera.transform.position, transform.forward);
		Debug.DrawRay(camera.transform.position, transform.forward, Color.green);
		if (Physics.Raycast(ray, out hit))
		{
			if (hit.collider.CompareTag("spinner"))
			{
				hit.collider.gameObject.GetComponent<SpinnerController>().SpinItself();
			}
			else
			{
				Debug.Log("not a spinner");
				gameObject.GetComponent<AudioSource>().PlayOneShot(loose);
			}

		}
	}

check in inspector what is different between object and object clone during run time/play mode

does the clones have the right tag applied??

for a quick test to find out if its a tagging problem remove the tag check for the ray command

             if (hit.collider)
             {
                 hit.collider.gameObject.GetComponent<SpinnerController>().SpinItself();
             }

if its a tagging problem you will need to add the missing components or tags during repawn
IT IS COMMON TO HAVE SLIGHTLY DIFFERENT SETTINGS ON SPAWNED OBJECTS/clones
so changes might be needed in the VOID START/VOID AWAKE/ON SPAWNED()/ON ENABLED etc… where its appropriate in your case

hope it helps
goodluck