How to code fading transparency

Last updated: January 28, 2025

If you want this to reveal a secret doorway, turn the collision off with the Collision tool!
  1. Select the part you want to code and open up the code builder.

  2. From the events section, place a when player clicks object, followed by a tween transparency to part. Change the 0 to 1 to make it clear, and change the seconds to how long you want it to take to change.

  3. From the Control section, place a wait --- seconds and change the number to how long you want it to stay transparent.

  4. To turn it back, place another tween transparency to part, but this time, leave the number at 0. Again, change the seconds to your liking.

  5. Lastly place another wait --- seconds to end it until it is clicked again.

Was this article helpful?

Thanks for your feedback!