How do I increase value of local instance on layout change?

0 favourites
  • 4 posts
From the Asset Store
Plugin Transition Layout C3. Layout opening and closing animation for C3. Quickly set up transitions between lay
  • Hey all. I asked a question about increasing the value of a global variable and it was resolved. Now I'm curious how to increase the value of a local instance variable (LIV) when the layout is changed. If the LIV is on layout 1 and the view is switched to layout 2, the LIV on layout 1 stops increasing.

    How do you program for this? Thanks everyone.

  • You should use global variable for this. What are you trying to achieve with the instance variable?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You should use global variable for this. What are you trying to achieve with the instance variable?

    I have 10-12 objects (crops) that are "growing". Every second, the system increases the local variable (growth) of each object so that when it hits 100, it can be harvested.

  • You can't increase the objects from another layout however it is possible to return to the layout and they have the same variables as when you left if you give the objects 'Persist' behaviour.

    If you want them to grow while you're in another layout you would need to use global variables or an array, or another option is to make them global objects but they are invisible but that is a strange option to go for.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)