A warning before a enemy spawns

Hello,
I have randomly spawnend circles and I want that before they are spawned that there is a warning or something like that at the same position as the circle

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CircleSpawn : MonoBehaviour
{
    public GameObject Kreis;
    float randX;
    float randY;
    Vector2 Spawn;
    public float spawnRate = 2f;
    float nextSpawn = 0.0f;

    void Start()
    {
        
    }

    
    void Update()
    {
        if (Time.time > nextSpawn)
        {
            nextSpawn = Time.time + spawnRate;
            randX = Random.Range(-15.16f, 15.16f);
            randY = Random.Range(-6.82f, 6.82f);
            Spawn = new Vector2(randX, randY);
            GameObject KreisKaputt = Instantiate( Kreis, Spawn, Quaternion.identity) ;
            Destroy(KreisKaputt, 10f);
        }

    }
}

Sry for the bad english ^^
Thx for all answers :slight_smile:
`

[163858-particle-system.zip|163858]

Add [SerializeField] ParticleSystem spawnEffect;

Extract the code in Update() to a new function, and make sure to add IEnumerator instead of void or whatever is set there.

Make a new line after line 27, and put:
`var spawnParticles = Instantiate(spawnEffect, Spawn, Quaternion.identity);

yield return new WaitForSeconds(time desired);

Destroy(spawnParticles);`

After these 3 lines, put the rest of your code.

Make sure to customize the particle system I sent so that it suits your game.