I have a tk2dSprite (a laser) that I have create as a prefab. There are four lasers positioned in opposites corners of a rectangle firing in.
I used a Rigidbody2d to push with force and isTrigger to detect on collision with the player. This bit works well.
The problem is when they pass the player and the the lasers collide. I have removed the laser collision from the physics matrix yet still they collide.
So I tested the layer to see what was return and see the instantiated object (the laser) is marked as "Untagged" and not "Laser" as is in the prefab.
Here is my calling code:
GameObject laser = Instantiate(Resources.Load("Prefabs/Laser")) as GameObject;
laser.transform.position = turret.transform.position;
laser.transform.rotation = turret.transform.rotation;
laser.transform.Rotate(0, 0, tempAngle);
I have even tried adding the tag in again
laser.tag = "Laser";
But no joy, any ideas?