How to made Change Scene Button?

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

Hello everyone today I’m creating 2d game but I don’t know how to made a change scene button (play button) can someone help me? I’m sherch for godot doc but them script I can’t use on my game!! the error said : Script inherits from native type ‘CanvasLayer’, so it can’t be instanced in object of type: 'Button’

:bust_in_silhouette: Reply From: USBashka

The easiest way to do this is connect the button signal “pressed” to a script and use function change_scene(path). You can connect signals in Node tab in the editor