Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

here are any way to restart only one object by code?

Discussion in 'Documentation' started by AstridLongi, Apr 20, 2020.

  1. AstridLongi


    Nov 4, 2019
    Hello I have an object that I enable and disable with a button, the problem is that deactivating it also deactivates its scripts (even linerenderer) and it is necessary that when I activate it again the scripts will run again, I was looking for but I can't find a solution, there are any way to restart only one object? try instantiate but just create and create more objects with different shapes and if I try destroy the newone turns error
  2. Benjamin_V


    Apr 1, 2019
    Hi, I'm not sure what you are trying to do but you should look at the onEnable() function.