noob question...change color only while colliding

Get help using Construct 2

Post » Tue May 07, 2013 12:37 am

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 TouchiMedia2013-05-07 00:39:27
B
4
Posts: 10
Reputation: 245

Post » Tue May 07, 2013 12:42 am

habe you tried ELSE ?

ELSE

Invert this
'ObjectA' 'is overlapping ObjectB' --> 'set ObjectB animation to "STANDART"'.
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Tue May 07, 2013 12:43 am

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.
B
4
Posts: 10
Reputation: 245

Post » Tue May 07, 2013 12:44 am

Where do you find this else and if's statements?? I was trying to look for them...Thanks
B
4
Posts: 10
Reputation: 245

Post » Tue May 07, 2013 12:48 am

Click on Your Event --> rightclick and choose ELSE

for more there is a Plugin called Branch (IF,Elseif...)
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Tue May 07, 2013 1:10 am

My solution didn't work, I thought so cause collision happened quick. I will try the else.. thanks for that
B
4
Posts: 10
Reputation: 245

Post » Tue May 07, 2013 1:20 am

It won't let me, it's greyed out... ???
B
4
Posts: 10
Reputation: 245

Post » Tue May 07, 2013 1:21 am

can you upload a capx of your project?
B
18
S
6
G
3
Posts: 197
Reputation: 4,129


Return to How do I....?

Who is online

Users browsing this forum: Naightwolf and 21 guests