Pretty simple I guess but couldn’t find an answer yet.
I have an instantiated Gameobject from c# and I want to exchange the prefab of it without Destroying and re-initializing it again.
fooPrefab is a Sphere
barPrefab is a Cube
GameObject tile_go = Instantiate(fooPrefab, position, Quaternion.identity);
When I just overwrite it via
tile_go = Instantiate(barPrefab, position, Quaternion.identity);
I get 2 instantiated GameObjects. I can’t destroy the former one because then I delete necessary references from that object that I need to keep
Is there a way to keep the Gameobject and just exchange the prefab so the Sphere becomes a cube?
Hope someone can help me out here. Sorry for the bad formatting half of formating is wonky and the other half is not possible to find in the help