Card Game State Debugger

Godot Version 4.3 (latest)

I’m having an issue with following a tutorial, a bit embarrassing I admit. I am following the Godot 4 intermediate Card Game Course and I am having an issue with the card_base_state.gd. Essentially is looking to have the label revert to say “BASE” with a color change vs the actual sprite’s label and color - I think. I have copied everything across from the little training program from scratch very slowly would anyone know if this is a version issue? Or am I just blind?

card_state.gd set as below:

class_name CardState
extends Node

enum State {BASE, CLICKED, DRAGGING, AIMING, RELEASED}

signal transition_requested(from: CardState, to: State)

@export var state: State

var card_ui: CardUI

func enter() → void:
pass

func exit() → void:
pass

func on_input(_event: InputEvent) → void:
pass

func on_gui_input(_event: InputEvent) → void:
pass

func on_mouse_entered() → void:
pass

func on_mouse_exited() → void:
pass

Following this I have the card_base_state.gd as

extends CardState

func enter() → void:
if not card_ui.is_node_ready():
await card_ui.ready
card_ui.reparent_requested.emit(card_ui)
card_ui.color.color = Color.WEB_GREEN
card_ui.state.text = “BASE”
card_ui.pipvot_offset = Vector2.ZERO

func on_gui_input(event: InputEvent) → void:
if event.is_action_pressed(“left_mouse”):
card_ui.pivot_offset = card_ui.get_global_mouse_position() - card_ui.global_position
transition_requested.emit(self, CardState.State.CLICKED)

Thanks just for spending the time on the read.

Can you reformat into a code block using three back ticks?

```
# your code
With indentations
```

Renders like

# your code
   With indentations 
extends CardState

func enter() -> void:
    if not card_ui.is_node_ready():
        await card_ui.ready
    
    card_ui.reparent_requested.emit(card_ui)
    
    # Ensure the CardUI node has these properties properly defined
    if card_ui.has_node("color"):
        card_ui.get_node("color").color = Color.WEB_GREEN
    else:
        push_error("Missing 'color' node in CardUI")
    
    if card_ui.has_node("state"):
        card_ui.get_node("state").text = "BASE"
    else:
        push_error("Missing 'state' node in CardUI")
    
    card_ui.pivot_offset = Vector2.ZERO

func on_gui_input(event: InputEvent) -> void:
    if event.is_action_pressed("left_mouse"):
        card_ui.pivot_offset = card_ui.get_global_mouse_position() - card_ui.global_position
        transition_requested.emit(self, CardState.State.CLICKED)

you’re accessing card_ui.color and card_ui.state directly, this might be nodes rather than direct properties,
you better canusing get_node() instead of card_ui.get_node(“color”) and card_ui.get_node(“state”)