0 votes

Pretty simple question, and i hope its simple to answer.

I just want a little transition between my level change so it doesnt look that ugly.

asked Apr 17 in Engine by LurreAllire (25 points)

1 Answer

+1 vote
Best answer

This is very simple transition effect

  1. Add a CanvasModulate and Tween to your level.
  2. When you are ready to change your level run this function

    func level_change_trans():
        var time = 2
        $Tween.interpolate_property($CanvasModulate,"color",
        Color(1,1,1,1),Color(0,0,0,0),time,Tween.TRANS_LINEAR,Tween.EASE_OUT)
        $Tween.start()
    

It just blackens the screen and its not that good but you can modify according to your needs.

answered Apr 17 by supper_raptor (667 points)
selected Apr 17 by LurreAllire

So, I made what you said, attached a script to the Canvasmodule and load automatically into the scene and calling the function with my level transition one. The problem is that there is nothing. I tested if the function is being executed (via print) and it says it gets executed. Am i doing something wrong? Do i have to wait till i switch scenes?

So, i disabled the transition between levels and i don't even see a black screen.
I am working on this for 3 hours now.
This cant be that hard right?

Omg it worked.
I had to to change the name of the Canvas.
thx for helping

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.