(Solved) Can someone explain this, please?

I downloaded an example and it works fine if I open it, but it doesn’t if I reproduce it exactly the same way in a new project.
Explaining better:
The top code is from the downloaded file and the bottom is what I made.
The top one works, the bottom doesn’t.


The top code is from the downloaded file and the bottom is what I made.
Note that in the top image I have the field “from” marked in red, but not in the bottom image.
Also the description of configuration window (marked in green) are not equal.
If I try to create another equal event in the downloaded file, the field “from” doesn’t show up.
Can someone explain what happens, please?
Thank you!


Is it possible the example is from an older version of Gdevelop or it uses an extension?

Either way. The only difference seems to be the from field. If that’s the case then you just need to add another action before the tween to set the value to zero each time otherwise it’s going to use the current value as the starting point.

image

Thanks again!
You help me a lot.
Yes! I think the file is from an older version.
But in this case, I thought GD should avoid it to open or give some warning, otherwise we can face problems if publishing it? Or not? They must have had a reason to eliminate the field “from”, because that was so much easier do it at once than have to add another line of code.

1 Like

You would think it would come up as an invalid function. Maybe it’s an oversight or they didn’t want to break the older code.

Maybe you’re right!
The odd thing is I commented this issue in another topic and MrMen told me that the code worked for him without adding the line you told me, even without the “from”. At least he didn’t mention any alteration.

It will work the first time if the value is already zero. Maybe MrMen only tried it once or looked at the code and on it’s substance, it’s the correct syntax.

it never worked for me even the value being zero.
But Thank you! Problem solved.

1 Like