(SOLVED)Scale Tween Issues

Hi there, can someone take a look at my events sheet and tell me what the heck I’m doing wrong? I’m trying to make it so that the ingredients in the video will “grow” back over time (ie, scale from 0 to 1 over the course of a second or so, still playing around with timing) but the tween just…is not working at all…I have the behavior added to the mushroom sprite so…what the heck?

Video of gameplay:

Hey!
The only thing I can think of, would be that scaling your mushroom to 0 would bug out in one way or another. It’s like telling GDevelop “Don’t delete the mushroom, but delete it.”

If you try swapping the “Scale Mushroom to 0” with “Scale Mushroom to 0.1 (or 0.01)” it might work.

If that still doesn’t work, then reply on here again and I’ll look around for other potential causes :smile:

Happy Developing and Merry Christmas! :christmas_tree:

2 Likes

To me that seems like a bug but it appears to be a “feature”.

From a post in 2024:

Honestly, it seems like it would be simple for GD to prevent this. Just check if the value is set to zero and then start the tween from something like .000000001 or .25 like in the post.

I guess the issue is that the tween multiples the original value by another value and since any number times zero is zero, it doesn’t work. It’s weird though because I’m sure any other tween can work with the start or end value of 0. I guess it’s the nature of either scaling or the scaling tween method.

1 Like

I also explained it in this comment:

If you try it yourself, you will see very different results with these 2 targeted values. It’s not something the editor can choose for users.

2 Likes

Thank you. I still don’t understand why there’s a difference between tweening a scale value from 0 to 1 and any other parameter like width, position or a variable. It seems like there would be a simple formula to change the value per frame over x seconds. I’m sure there’s an important distinction. I just don’t know what it is.

It’s not a frame rate dependency issue. If you multiply something by a constant value “a” N times and want to get 0 in the end, this value “a” must be 0, so even at the 1st step, you’ll get 0.

Take a look at this example which tween with a bouncePast:

As you can see, the linear one doesn’t overstep much when growing, but overstep a lot when shrinking (almost half the targeted size)

Whereas, the experiential one acts the same way in both direction. It oversteps the same percentage:

this helped!! for some reason when i read that the value “cannot be less than 0” i thought “okay so at least 0 is acceptable??” brain fart.

thanks for the help!

1 Like