Interesting Issue

0 favourites
  • 5 posts
  • I'm not sure if I am doing something wrong or not. Please forgive me if this turns out to be something stupid as I come from a background in flash as3 and am still trying to get used to using construct 2.

    I have a simple layout with 3 instances of a sprite named "Space".

    Each instance of Space has its own variable called "spaceID".

    They have the values 1, 2, and 3 respectively. They have a simple looping animation with 2 frames.

    I also have a global variable called "acitveSpace".

    I have set activeSpace = 2;

    On the event sheet I simply have one item (besides declaring the global and giving it the value of 2). This is as follows:

    Space->activeSpace=spaceID, Space->Start animation.

    All spaces except for 2 start animating.

    But when I chance (activeSpace=spaceID) to (atciveSpace not= spaceID) then the correct space (#2) animates as it should.

    Did I miss some core logic? LOL both variables == 2 but it only works if I put the condition not equal.

    Please let me know if I missed something. Thanks ;-)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Remember that these variables must have the same data type. (number - number). If so, this is really strange.

  • pace->activeSpace=spaceID, Space->Start animation

    This will restart the animation every tick so it will always be on the same frame and appear to be stopped. The other two sprites animate normally because the animation speed > 0. When you invert it the reverse happens, the other two have their animations reset every tick.

    You'd need something like:

    +System: On start of layout
       - Space: Stop animation
    
    +Space.spaceID = activeSpace
    +System: Trigger once
       - Space: Start animation
    
  • Moving to 'how do I' since this doesn't appear to be a bug report.

  • Thank you guys... I learned something new. ;-) And it is now working brilliantly! The trigger once while true did the trick along with an event group. I've owned construct for a few months now... but am just now really getting into it. Thanks for your patience.

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