Tweening created objects

Hello everyone!


I wanted to create an object and tween it to 0-255 opacity so that it does not just pop in the scene. My code does not work, how do I code this? Thank you so much!

Duplicate that tween action
And in top one change opacity to 0 and identifier from Opacit to Opacit0
And amount of seconds to 0.02
Add wait action between them of 0.02 sec

I think I did it wrong

Mine don’t work

Maybe I’ll just add the object in the scene instead of creating it. Setting its opacity to zero then tween it to 255 after an event.

I think ZeroX4 meant to duplicate the tween in another event. And that instead of tweening opacity to 0, you create it and instantly set the opacity to 0 so it is invisible. I have no idea what he meant about the .02 seconds, but I have to point out that .02 seconds is a short amount of time. If I had to wait .02 seconds in life for anything, it would seem to me that I got it instantly. So I slowed your tween down to 2 seconds so you can see it is working, it’s just working really fast.

ohhh :sweat_smile: thank you thank you.

Edit: It worked!!! Thank you both @Lucky-j and @ZeroX4

2 Likes

@Szeyal @Lucky-j
To be clear i literally meant duplicating tween action in same exact event
1st tween would change opacity to 0
Where now you use wait action with same time as 1st tween so 0.02
Now 2nd tween change opacity to 255
So you Szeyal had done it correctly
You just did not have wait action between tweens
Also 2nd tween should not be 0.02 cause that is like instant change
And that is why 1st tween have it at 0.02
1 sec or 2 secs would make sense for 2nd tween so you could notice tween effect of going from 0 to 255
There is literally action called Wait in action list
Just type wait in search bar when adding action

And all would work perfectly fine

1 Like

Oh that makes more sense, I missed the wait in your instructions. For some reason I saw “Add what action between them”.

Ohhhhh I didn’t know about the “wait action”, my fault :sweat_smile: Thank you @ZeroX4

Edit: I literally was about to ask how to delay an action. You saved me.

To be fair i did not know opacity is opacity
I was sure opacity for tweens in something else than opacity action itself
Pretty clever from your side

And now both creation actions could be in same event like

So it would look like
ONE SINGLE EVENT

Create something somewhere
Change opacity to 0 of that something
Tween opacity of that something to 255
Create ANOTHER something somewhere
Change opacity to 0 of that ANOTHER something
Tween opacity of that ANOTHER something to 255

BE AWARE identifiers “Names” of tweens can’t be the same
So for 1st object would be FOR EXAMPLE 1Opacity255
And for 2nd 2Opacity255
It could also be named TweeA and TweenB or First and Second
BUT NEVER the same
AND that is IF you create two of same objects in at the same time
IF they were different objects they could have same identifiers
But tweens with same identifiers can’t run at the same time if they are for same objects
Or are not object related

So there is no need for 2nd event
But whatever if it works it works that is all we should care

@Szeyal you can apply this if you care for it to be in one single event
Yet i have no idea what kind of benefit you would get from that

2 Likes

Be aware
Wait is force of nature
Or speaking human language you can’t stop it
IF you have some pause menu or like something that should stop whatever that is using wait action
Once wait action kicks in it will count down time and do whatever was next

For example you have enemy that should explode 1 sec after loses all HP
You kill enemy and you pause game yet you had that explode action after wait action
It will execute explode regardless of you pausing the game

To me it looks simpler as a single event, with a small wait between them so they don’t appear exactly the same. And I’m glad to know about the identifiers too.

Thank you for this @ZeroX4 I’ll keep this in mind.

As a note: object lists for an event do not get cleared so if you have “create object a” then tween it, then another “create object a” then tween it, the second tween will apply to both created object A.

1 Like

@Szeyal @Lucky-j
I think i did you some harm here
Technically in this specific case tweens with same name on same object should work
Think of it as placing change size action directly under create object action
It will only affect that object
If you place change size action in separate event event it will affect all of that objects

BUT there are A LOT of cases where tweens with same identifier/name will conflict
That is why i advise and personally avoid using same tween identifiers
And never i had problems with them

Imagine it as licking your finger after touching chili
Either you did not have any chili on your finger and you won’t beg for water in a moment
Or you 1st wash your hands and then lick your finger and always be safe

But bottom line it is like trying to move one object to the left and right at the same time most of the times you will create conflict
So like i said i advise and personally avoid using same tween names for same object

2 Likes

Thank you for your explanation and advice. I appreciate you taking the time to clarify the situation and offer a detailed example. Your analogy makes it much easier to understand. I’ll definitely keep this in mind moving forward. Thanks again for your help!