Home > other >  How can I replace prefab with other prefab when it toches something? Unity / C#
How can I replace prefab with other prefab when it toches something? Unity / C#

Time:09-27

I have 1 prefab witch can run and when it touches some object it has to change to another prefab without reloading the scene is this possible? If yes then how?

CodePudding user response:

you have to take the position of your object when it touches another object and instantiate your prefab when it touches the other object

CodePudding user response:

When the first prefab touches something, you could instantiate the new prefab at the first ones location, and then destroy the original prefab, or set it inactive.

  • Related