0 votes

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():

func process(delta):
if Input.is
if gettree().getcurrentscene().getname() == "home-garden": Transition.fade_to("res://scenes/home-floor1-livingroom.tscn")

func onArea2Dbodyentered(body):
if body.getname() == "Player":

in Engine by (92 points)

1 Answer

+1 vote

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.

by (1,456 points)

Thanks a lot!!

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.