![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
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)