Change actor size for 3 seconds - how?

HunnenkoenigHunnenkoenig Member Posts: 1,173
edited November -1 in Working with GS (Mac)
It drives me crazy.

I managed it once, but after my project just crashed into nirvana and I had to start from scratch, I don't know anymore, how I did it.

I try everything with "change size" and "timer" and making custom attributes and nothing works.

I want a racket change size of +20, if a ball hits it. Now I actually can change the size +20, but I can't change it back after 3 seconds.

Any advice, how it could be solved?
I know, I did it fairly simple once, but now I start to develop more and more complicated rules and it still doesn't work :-)

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Should just be a simple Timer like this:

    Rule
    When Actor collides or overlaps with Actor of type Ball
    Change Attribute: self.Width To self.Width+20
    Change Attribute: self.Height To self.Height+20
    Timer
    After 3 seconds
    Run To Completion
    Change Attribute: self.Width To self.Width-20
    Change Attribute: self.Height To self.Height-20
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Yay, it worked! Thanks.
    I tried something similar too, but i have to learn to use the expression editor, not just writing something into the field, because it sometimes don't work or I write something wrong into it...
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    yea, you always need to use the expression editor, manually typing it in won't work. Caused me a lot of headaches in the early days :)
Sign In or Register to comment.