How to make my enemy respawn (Help Wanted)

I want my enemy to just respawn to the same place as it started here’s my script im so confused it doesn’t work

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

public class Enemyrespawn : MonoBehaviour
{
public bool Death;
public float Timer;
public float Cooldown;
public GameObject Enemy;
public string EnemyName;
GameObject LastEnemy;
// Use this for initialization
void Start()
{
//If you want, add this line:
Death = false;
this.gameObject.name = EnemyName + “spawn point”;
}

// Update is called once per frame
void Update()
{
if (Death == true)
{
//If my enemy is death, a timer will start.
Timer += Time.deltaTime;

}
//If the timer is bigger than cooldown.
if (Timer >= Cooldown)
{
//It will create a new Enemy of the same class, at this position.
Enemy.transform.position = transform.position;

Instantiate(Enemy);
LastEnemy = GameObject.Find(Enemy.name + “(Clone)”);
LastEnemy.name = EnemyName;
//My enemy won’t be dead anymore.
Death = false;
//Timer will restart.
Timer = 1;
}
}
}

Please use code tags. It’s hard to read your code without them.

From first look I can suggest replacing:

Enemy.transform.position = transform.position;

Instantiate(Enemy);

With:

Instantiate(Enemy, transform.position, false);

You were changing the position of the prefab and not the instantiates object and I’m not sure if this is what you wanted.

Also, I’m not sure what the Last Enemy GameObject is actually being used for. Plus, you are searching for your GameObjects using GameObject.Find. I would suggest using tags if possible.

Again, this is at a first glance. If you could perhaps be more specific with what isn’t working, and what is actually happening, I’ll be happy to help further.

EDIT: On a side note, camelCasing is standard/best practice for normal variable naming.

Hello ItzChris92 the script actually doesn’t work so im trying to use the internet for at least a clue how to start my script but if your already using if you dont mind can you please share it