Page 3 of 3

Re: Variable increments when I press any button, not the ones I want to.

Posted: Mon Feb 22, 2021 1:59 am
by olikante
Yeah... I know why it is happening. It increments on disable. Other buttons lead to different scenes, so they are disabling my flower and incrementing my variable. It is a shame that it can't be on click or something else. I need to figure out some other way to use it in my setup...

Re: Variable increments when I press any button, not the ones I want to.

Posted: Mon Feb 22, 2021 8:12 am
by Tony Li
If you change scenes using any of the methods listed here (How To: Change Scenes) the Increment On Destroy component will not increment when you change scenes.

Alternatively, if you can't use any of those methods, you can call PixelCrushers.SaveSystem.BeforeSceneChange() before changing scenes as described in that link.

Re: Variable increments when I press any button, not the ones I want to.

Posted: Mon Feb 22, 2021 12:08 pm
by olikante
Ok, I will check it out.

I'm truly impressed by the support.

:)

Have a nice day!