noob question...change color only while colliding

0 favourites
  • 8 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Sorry if this has been covered, I did a quick check on front page and didn't see much.

    I have two objects. I want it so when ObjectA is colliding with ObjectB , ObjectB plays animation frame 2 or a different animation.

    I know how to do this with Events.

    My issue is that I get it to change color, but stays that color even when ObjectA stops colliding. I want it to revert back to original animation/frame (different color basically).

    Is there a relatively easy way to do this , I can't figure it out.

    I've done:

    'ObjectA' 'is overlapping ObjectB' --> 'set ObjectB animation to "animation2/frame2"'.

    Within ObjectB's animation - I have two animations. Both consist of one frame. First animation is when they aren't collided (say black) then second animation is exact same but color green.

    I have also tried 'ObjectA' 'on collision with ObjectB' 'set ObjectB animation to "animation2/frame2"'.

    It switches but stays on that Animation/color even when objects stop colliding. I have also tried using animation frames but I don't want it to loop - as it makes the object blink from animation. I want it to stay on animation 2 or frame 2 while it's colliding, but revert to animation 1 or frame 1 when it stops colliding..

    Help - I probably made this more complicated then it needs to be..brain fart <img src="smileys/smiley18.gif" border="0" align="middle" />

  • habe you tried ELSE ?

    ELSE

    Invert this

    'ObjectA' 'is overlapping ObjectB' --> 'set ObjectB animation to "STANDART"'.

  • I already figured it out.. damnit knew it, haha

    Basically, when call animation 2 - make a second frame with the original color. Don't have it loop. Call animation from beginning.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Where do you find this else and if's statements?? I was trying to look for them...Thanks

  • Click on Your Event --> rightclick and choose ELSE

    for more there is a Plugin called Branch (IF,Elseif...)

  • My solution didn't work, I thought so cause collision happened quick. I will try the else.. thanks for that

  • It won't let me, it's greyed out... ???

  • can you upload a capx of your project?

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