I need to make a frame to my game that contains the restart button . and quit button and the timer . when i make the canvas layer the buttons and the timer disappear and if I didn't they (frame) move as the move of the player not the move of the camera (it is a 2d game)

  • Toxe replied to this.

    haidarwayzani the buttons and the timer disappear

    What do you mean by that?

    haidarwayzani and if I didn't they (frame) move as the move of the player not the move of the camera

    What is the parent object of your CanvasLayer?

    i make a separate scene for the frame . i put the buttons and everything . the parent is node 2d so the buttons appear normally but move by the move of the player . if i put the parent as canvas layer , the buttons doesn't appear in the game

    We need to see your scene tree structure.

    Please add this in a _ready() function and post the output:
    get_tree().get_root().print_tree()

    .
    Node2D
    Node2D/levy
    Node2D/levy/Sprite
    Node2D/levy/CollisionShape2D
    Node2D/levy/AnimationPlayer
    Node2D/levy/Camera2D
    Node2D/levy/frame
    Node2D/levy/frame/quit button
    Node2D/levy/frame/quit button/Sprite
    Node2D/levy/frame/res button
    Node2D/levy/frame/res button/Sprite
    Node2D/levy/frame/RichTextLabel
    Node2D/levy/frame/RichTextLabel/@@2
    Node2D/levy/frame/RichTextLabel/Timer
    Node2D/TileMap
    Node2D/ParallaxBackground
    Node2D/ParallaxBackground/ParallaxLayer
    Node2D/ParallaxBackground/ParallaxLayer/Sprite
    Node2D/Button
    Node2D/Button/Sprite
    .
    Node2D
    Node2D/levy
    Node2D/levy/Sprite
    Node2D/levy/CollisionShape2D
    Node2D/levy/AnimationPlayer
    Node2D/levy/Camera2D
    Node2D/levy/frame
    Node2D/levy/frame/quit button
    Node2D/levy/frame/quit button/Sprite
    Node2D/levy/frame/res button
    Node2D/levy/frame/res button/Sprite
    Node2D/levy/frame/RichTextLabel
    Node2D/levy/frame/RichTextLabel/@@3
    Node2D/levy/frame/RichTextLabel/Timer
    Node2D/TileMap
    Node2D/ParallaxBackground
    Node2D/ParallaxBackground/ParallaxLayer
    Node2D/ParallaxBackground/ParallaxLayer/Sprite
    Node2D/Button
    Node2D/Button/Sprite
    This is the output

    I assume the buttons are of type Button. What are the types of levy and frame?

    It looks like Godot 3.x. What's the full version?