raycastHit 2D

Hi,here is what you need to know.
I have 2 character that each of them had script attached to it and in each script the code are the same(for some reason) that is this.

At first these script are disable, after some event one of those script would be enable and after the raycast worked script would be disable and that other script would be enabled.
Here is my problem:
You see when transform of the character had been changed that character enabled a button, but when i click on that button to do something that other character transforms is changed that’s mean its raycast worked while i don’t hit that other character.
PS: the tag of two character are the same and the distant between them is low.

i’m a bit confused what your question really is… but i’ll try, maybe you need change your if-statement.
because right now you just look for any collision detection…

try maybe something like:

void Update () {
	RaycastHit2D hit = Physics2D.Raycast (Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
	if (hit.collider == transform.parent) {
		if (Input.GetMouseButtonDown (0)) {
			santal.transform.position = new Vector3 (-5.50f, transform.position.y, -1f);
			santal.gameObject.GetComponent<SpriteRenderer> ().flipX = false;
			this.enabled = false;

hope this helps.