Tween object animations

Hello all!
I’m trying to familiarize myself with the tween behavior with a little practice platform game I’m working on.

What I want to do is, when my Player jumps on a Mushroom, I want the mushroom to do a squishing animation (if that makes sense) and then return to its original scale.

So far I’ve managed to make the mushroom almost shrink to the desired size when the player jumps on it but what happens is when they do, it snaps to the scale and stays that way. Also, the bottom part of the mushroom object raises instead of it lowering, so it looks like the mushroom is floating.

So, what I’m trying to do is:

  1. Make the mushroom “squish” and return to its correct scale after the jump and;
  2. Have the mushrooms bottom to stay on the ground

Any help would be most appreciated.

This video will probably step you through what you’re looking for.

That video did help with the animation, thanks! Alas, I still can’t seem to keep the mushroom object anchored to the ground.

Try moving the origin point down to the bottom of the object. Since tweening works based off of that, the bottom of your mushroom will be fixed after doing that.

1 Like

Perfect! It took me awhile to figure that out but it worked!

awesome my boy. also, most beginners have trouble making buttons so ill show you how to do that too.

First, you need to add an event. So click “add condition” and look for “Mouse cursor is on/touching an object.” select that and for the action you want to put “tween object scale”. (make sure you have a tween behavior for the object.) now what you want to do is set the x and y to 1.1, easing should be easeoutquad, make sure scale from center is set to yes, make the tween identifier anything you want, and time should be 200. oh and in that same event put a “once” condition so it doesnt go all wonky.

and then after that add a new event and make it the same as the first one, except without any actions and get rid of the “once” condition. under that event add a new one, and drag it to the right to mae it a subevent. then you add a mouse button pressed condition, and then make the action anything you want like “change scene” or “play sound”. under that add a new event, NOT a subevent, and copy everything from the first event and put it in there. Then in the new event select the mouse touch condition and make it inverted. then take the x and y and switch it back to 1. this makes it do when you hover your mouse over the button it bounces up a bit in size, and when you take your mouse away it goes back to its normal size. and then because the click is a subevent, when you click it should change the scene or whatever you added. if its not a subevent, then it will do the action even if you click outside the btton. use this screenshot to help you:

1 Like

Wow! That’s a cool effect! Thanks for that!

your welcome! if you have any other questions you can always ask. im currently working on a game right now and learning new stuff too so :slight_smile:

1 Like