#Was following an tutorial and got an error that didn't appear on it

37 messages · Page 1 of 1 (latest)

torpid pendant
#

this video: https://www.youtube.com/watch?v=sKuM5AzK-uA at 30:18

the code


var  scene_path_to_load

func _ready():
    for button in $Menu/CenterRow/Buttons.get_children():
        button.connect("pressed", self, "_on_Button_pressed", [button.scene_to_load])
        
func _on_Button_pressed(scene_to_load):
    scene_to_load = scene_path_to_load
    $FadeIn.show()
    $FadeIn.fade_in()

func _on_FadeIn_fade_finished():
    get_tree().change_scene(scene_path_to_load)

In this complete tutorial you'll create a game's title menu that supports mouse, touch and keyboard input. With a fade-to-black transition!
Intermediate Godot 3 course: https://gdquest.mavenseed.com/courses
Beginner Godot 3 course on Udemy: http://bit.ly/guis-godot-course

Download the project: http://bit.ly/godot-3-title-screen-demo
Find all ou...

▶ Play video
jovial stump
#

And the error?

torpid pendant
#

my pc is slow, im taking the pic

digital carbon
#

That's a warning, not an error. You can safely ignore it

jovial stump
#

GDQuest might have deactivated it

torpid pendant
#

i clicked the button...

jovial stump
#

The button you clicked doesn’t have a property scene_to_change_to, I think

torpid pendant
#

ill go a back a bit to see if I missed anything

#

I did the code at 1AM

torpid pendant
#

I rewrote the code a bit and now is working.

#

weird, I might forgot somenthing

#

anyway thanks for the help.

#

nop, im wrong, it stays up for a bit then crashes

jovial stump
#

Still the same error?

torpid pendant
#

yes

jovial stump
#

Did you check if you correctly set the property on your button?

torpid pendant
jovial stump
#

Can I have the code on the button?

torpid pendant
#
extends Button

export(String) var scene_to_load
jovial stump
#

Oh my, I just got it

torpid pendant
#

what I messed up?

jovial stump
#

scene_to_load = scene_path_to_load

#

You’ve inverted the affectation

torpid pendant
jovial stump
#

Oh, yeah, better

torpid pendant
#

i fixed it before when rewritting

#

but then, a few seconds and crash

jovial stump
#

Is it strictly the same error?

torpid pendant
#

yes

jovial stump
#

What if you change to var scene_path_to_load: String

#

(that’s typed GDScript)

torpid pendant
#

IT WORKED!

#

ill keep the thread open, but i waited long enough

#

seems to not crash