# Changing Size?

Member, PRO Posts: 100
edited April 2012
I'm sure, again, that this is extremely basic..

But how do I change the size of a character within a rule (not using the Change Size Behavior)? I want the size of the actor to change immediately, not over time with a growth rate. Thanks.

• Posts: 11,926
To change the size immediately, you don't need to use a timer. Just do the two change attribute behaviors (to 100) and then have a timer after that set to "after" ten seconds to change them back to 50, as you stated. You may need to check "run to completion" to make sure that the timer runs even if the original rule condition becomes false.

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

• Posts: 89
lol thanks..

for some reason, the editor won't let me set the rule
When actor1 overlaps or collides with actor2,

I want the size to go back to its original after 10 seconds, and this is not working. Any thoughts?
Try with Interpolate behavior and a couple of Rules, something like this:
Rule ------------------
when Actor1 overlaps or collides with Actor2

Interpolate Attribute: self.Size.Width = 100
Duration: 10 Function: Linear

Interpolate Attribute: self.Size.Height = 100
Duration: 10 Function: Linear
-----------------------

Rule -------------------
when self.Size.Width = 100

Interpolate Attribute: self.Size.Width = 48
Duration: 1 Function: Linear

Interpolate Attribute: self.Size.Height = 48
Duration: 1 Function: Linear
------------------------

I suggest you to keep a self.Size value that can be divided by 4, that's why I put 48 in Width and Height, so the Actor's image will look good, or else it'll look blurry and bad.
Also, if you need your Actor to go back to size 48 immediately, just put 0.01 as Duration into both last Interpolate behaviors

• Member Posts: 372
You could just do something like this:
Rule
When something happens,
change attribute (self.size.x to 100 or something)

Change attribute (self.size.y to 50 or something)

• Member, PRO Posts: 100
lol thanks..

for some reason, the editor won't let me set the rule
When actor1 overlaps or collides with actor2,

Set Timer: "For" 10 seconds
Change Attribute (self.size.width) to 100
Change Attribute (self.size.height) to 100

Set Timer: "After" 10 seconds
Change Attribute (self.size.width) to 50
Change Attribute (self.size.height) to 50

I want the size to go back to its original after 10 seconds, and this is not working. Any thoughts?