I’ve asked this question several times, but I haven’t gotten a good answer. I have a 2d game with a single helicopter that flies by. Now when the helicopter, called Enemy, reaches the end of the screen, it should loop back again in a random position and basically respawn multiples of itself. Could someone please help me with the script for this? Thanks!
You could make a trigger just outside the screen and attach a collider on the heli so when it hit trigger you can call a void/function in a script and tell it to move to a different transform.
so it would look something like this:
public class SomeCode : MonoBehaviour
public float someposx;
public float someposy;
void OnTriggerEnter(Collider col)
col.GameObject.transform.position = Vector3(someposx, someposy, Random.Range(-10.F, 10.0F));
Tough if your gonna use it you should edit it some because this is just a base to begin with