What to do to replace a Object?

Hi, I want to replace a GameObject (esenciaVFX, is a empty GameObject) for another (AfroditaVFX) and I write the next code, but only change in the Inspector, what gone wrong?

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

public class shopManager;
public GameObject esenciaVFX;

[Header("Effects")]
public GameObject AfroditaVFX;

void Start () {
esenciaVFX = AfroditaVFX;
}

From what you’ve posted the script is doing everything correct. in the inspector you should see both GameObjects as the same.

You didn’t post any code that shows that you are using the AfroditaVFX

Yes, but I one to change the GameObject in the scene

void Start () {
esenciaVFX = AfroditaVFX;
this.gameObject = esenciaVFX;
}
1 Like

did you get it working?