expression editor - get a value of the object's opacity

We can set the opacity to a value, but how come we can not get the current opacity value in the expression editor?

it would be useful to get the object to gradually become opaque :slight_smile:

You can do it through the condition and action related to the opacity. But surely it would be useful to do other things in function of the current opacity :slight_smile:

How do you gradually do it though?
Using lerp in the expression?

can you share the formula for a gradually changing value

Just by using the action with the “+” operator instead of the “=” operator.

Darkhog’s splash screen template use this effect:
[url]GDevelop splash for your games!]
The logo opacity is increased by 15 opacity… units per second :smiley:

Conditions : ... Actions : Do -128*TimeDelta() to opacity of object

This will remove 128 units per seconds. As maximum opacity is 255, your object will be made invisible in 2 seconds.
Check the platformer template, it’s applied on coins. :slight_smile:

thank you guys. This makes a lot of sense now :slight_smile: