How do scale a tile sprite up on the Y axis?

So on my mario game, I’m making a vine that grows upward from a Yellow block. I check for collision then create the vine which is a tile sprite. I set a tween for both Y and X separately because I want the growth on Y axis to be slow and the x to be instant. I’m having a problem getting the vine to be climable when I tween the Y scale with a negative number. If I use a positive number the vine will grows down and is climable.

I don’t understand why “-10” on the Y scale would get a different result than “+10” other than the direction.

Can anyone tell how I do?



I don’t think negative scale is really supported :thinking: In fact IIRC most objects can’t even render at a negative scale. Since that state is invalid, something internally must be breaking by not accounting for the possibility that this may be negative, be it the collision masks, bounding Box, or platformer behavior.

The workaround would be to set the position of the object while the tween is running to it's spawn position - thevine.Height(). You can store the spawn position in an object variable when creating the object. Then you can simply change the positive scale with it still going up.

1 Like

So I kinda got it to work. I had to create 2 vine objects. Vine1 is set up like how I had it. It grows upward but flickers after the tween is done and doesn’t function. The other “Vine2” is set up to spawn in the same spot but hidden and with the Y scale tweeked with a “-671” to put it at the end position of the vine1 animation and vine2 the Y scale in the positive and is set to finish its animation in 1 ms so it’s an instant vine. Then I delete faulty vine when tween animation is finished and show vine2. Some how it looks good and works. The only downside is that eventually I’ll have multi-player and if 1 player hits a vine box while underneath the 2nd player, the second player will be able to climb in mid air before the vine grows tall enough.

Thanks for the help.

1 Like