Make the text fade out

Hello, I am using an example game on GDevelop to help with the coding. When the player clicks on an item, I want the text to say “You have found a insert object name here.” And the name appearing is fine, but there’s two prominent issues:

  1. All of the text doesn’t fade out immediately after it appears which isn’t what I want.
  2. When the item’s name in “You have a found a _____” appears, it writes itself over the original text and doesn’t replace the text in green with the name of the next item click on. (example in photo)

“You have found a” and the item name are both separate text sprites.

^ Coding

^ The bottom right is an example of what I mean.

Look at adding the Tween behaviour to your text object, and using the fade tween. You can configure this to remove the text once the tween has finished. It’ll be a one liner to add to your code, and you won’t need to check on it.

1 Like

Alright, gotcha! I will try it and see how it works,

Edit: I added the tween (along with the behavior to the text) and it’s still not working? Did I add it wrong?

Move the the tween creation commands to the line above, with the actions that create collectedItem and collectedText. The tweens should only be added to the newly created objects. Get rid of the event where you check the x & y positions and the existence of the tweens. They’re not needed.

Also, check you have set the tween to delete object when tween finishes.

1 Like

Thank you! The tween animation has worked.