CanvasLayer overlapping, the transition doesn't work

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sakura37

I was trying to follow this tutorial(i have a black image,not the heart image):

I have a house, and when i’m near the door, if i’m pressing space it should fade in and out to the living room. Without the transition scene&script, it works well. But after I followed that tutorial, the CanvasLayer is overlapping my scene(it’s just black) and when i’m pressing space it changes the scene. So basically I can press anywhere space, not just near the door, and i see black if i’m not doing this. After this, the fading animation and the change of scene work. I think this part of the code is the problem, so I’m gonna leave it here:

extends Area2D

func _ready():
pass

func _process(delta):
if Input.is_action_pressed(“ui_accept”):
if get_tree().get_current_scene().get_name() == “home-garden”: Transition.fade_to(“res://scenes/home-floor1-livingroom.tscn”)

func _on_Area2D_body_entered(body):
if body.get_name() == “Player”:
set_process(true)

:bust_in_silhouette: Reply From: Adam_S

When using a process it will run by default.
That’s the reason why you can enter your house from everywhere.
So you have to put set_process(false) in your ready() function.

I can’t say for sure why your scene is black without to see your project, but i guess
the animation position is not at the start. If so, set it to 0 before playing your scene.

Thanks a lot!!

Sakura37 | 2019-09-18 17:29