Using same named childs for Prefab

Hey,

I have a problem with my enemy prefab.
I have attached 3 child to the prefab. When I instantiat like 4x my prefab they all have the same childs ; logically. But I think this cause the trouble that my physics2D.OverlapCircle isn’t working anymore.

The code is attached to the prefab. So maybe this .find is the bug, because it doesnt know which “collCheckRight” o.O’

Problems by understanding my written trash ?

My Pics:

25720-code.png

25721-prefab_issue.png

Problems in understanding ? Ask me ;P

Regards,

LifeArtist

Maybe you should replace GameObject.Find with transform.Find to find a child by name.

I think you should make the Transform variables inside your prefab public and set them to the correct child objects at design time. It should be more efficient than trying to find them at run time.