How to interpolate scale using expression
sinbot
Member Posts: 232
I would like to make an actor grow in size gradually over 2 seconds. I want to do this by using interpolation to increase the scale using an expression. Unfortunately I am bunk with expressions. Can someone suggest a working expression to make the actor expand to 3x its size??
Comments
Hi, here is a sample of I think what you are asking for. The white square uses a set size and target size (25 pixels and 75 pixels) to start at and grow too. For the blue one you can change the actor size to anything you want and it will always grow to 3 times that size. Check it out and let me know if you have any questions.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@sinbot Since Jamie showed how to size here's another spin on his example using only variables (no hard coded numbers). Advantage of variables (attributes in GS terms) is that you only have to change them in one place (setting the attribute itself) and then all the behaviors that use that attribute will be correct.
Thank you so much both of you! Going to check these out in the morning : )
Works perfect. Funny how I thought I would need an expression for the interpolation lol. Sometimes the obvious escapes me.
There are usually multiple ways of doing something, no worries.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page