0 votes

I was trying to follow this tutorial(i have a black image,not the heart image):
https://fede0d.github.io/blog/2016/02/07/Godot-Extra-Tips-2.html#final_result

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
actionpressed("uiaccept"):
if gettree().getcurrentscene().getname() == "home-garden": Transition.fade_to("res://scenes/home-floor1-livingroom.tscn")

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

asked Sep 12, 2019 in Engine by Sakura37 (82 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.

answered Sep 12, 2019 by Adam_S (981 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 How to use this Q&A? before posting your first questions.